┌────────────────────────────────┐ │ ░░░ ░░▓ ░▓▓ ███ ▓▓░ ▓░░ │ │ ~ M O O N ~ │ └────────────────────────────────┘
prd-web-01.centraldc.gr
LOCATION:
/usr/share/doc/grub2-common
☗ ROOT
↻ REFRESH
✎ EDIT FILE
EDITING: grub.html
<!DOCTYPE html> <html> <!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- This manual is for GNU GRUB (version 2.12, 18 March 2026). Copyright © 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. --> <title>GNU GRUB Manual 2.12</title> <meta name="description" content="GNU GRUB Manual 2.12"> <meta name="keywords" content="GNU GRUB Manual 2.12"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link href="#Top" rel="start" title="Top"> <link href="#Index" rel="index" title="Index"> <link href="#SEC_Contents" rel="contents" title="Table of Contents"> <link href="#Introduction" rel="next" title="Introduction"> <style type="text/css"> <!-- a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} a.summary-letter-printindex {text-decoration: none} div.center {text-align:center} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} kbd.kbd {font-style: oblique} kbd.key {font-style: normal} pre.display-preformatted {font-family: inherit} span.r {font-family: initial; font-weight: normal; font-style: normal} span:hover a.copiable-link {visibility: visible} strong.def-name {font-family: monospace; font-weight: bold; font-size: larger} td.printindex-index-entry {vertical-align: top} td.printindex-index-section {vertical-align: top; padding-left: 1em} th.entries-header-printindex {text-align:left} th.sections-header-printindex {text-align:left; padding-left: 1em} ul.mark-bullet {list-style-type: disc} ul.toc-numbered-mark {list-style: none} --> </style> </head> <body lang="en"> <div class="top-level-extent" id="Top"> <div class="nav-panel"> <p> Next: <a href="#Introduction" accesskey="n" rel="next">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h1 class="top" id="GNU-GRUB-manual"><span>GNU GRUB manual<a class="copiable-link" href="#GNU-GRUB-manual"> ¶</a></span></h1> <p>This is the documentation of GNU GRUB, the GRand Unified Bootloader, a flexible and powerful boot loader program for a wide range of architectures. </p> <p>This edition documents version 2.12. </p> <p>This manual is for GNU GRUB (version 2.12, 18 March 2026). </p> <p>Copyright © 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. </p> <blockquote class="quotation"> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. </p></blockquote> <div class="element-contents" id="SEC_Contents"> <h2 class="contents-heading">Table of Contents</h2> <div class="contents"> <ul class="toc-numbered-mark"> <li><a id="toc-Introduction-to-GRUB" href="#Introduction">1 Introduction to GRUB</a> <ul class="toc-numbered-mark"> <li><a id="toc-Overview-1" href="#Overview">1.1 Overview</a></li> <li><a id="toc-History-of-GRUB" href="#History">1.2 History of GRUB</a></li> <li><a id="toc-Differences-from-previous-versions" href="#Changes-from-GRUB-Legacy">1.3 Differences from previous versions</a></li> <li><a id="toc-GRUB-features" href="#Features">1.4 GRUB features</a></li> <li><a id="toc-The-role-of-a-boot-loader" href="#Role-of-a-boot-loader">1.5 The role of a boot loader</a></li> </ul></li> <li><a id="toc-Naming-convention-1" href="#Naming-convention">2 Naming convention</a></li> <li><a id="toc-OS_002dspecific-notes-about-grub-tools-1" href="#OS_002dspecific-notes-about-grub-tools">3 OS-specific notes about grub tools</a></li> <li><a id="toc-Installation-1" href="#Installation">4 Installation</a> <ul class="toc-numbered-mark"> <li><a id="toc-Installing-GRUB-using-grub2_002dinstall-1" href="#Installing-GRUB-using-grub2_002dinstall">4.1 Installing GRUB using grub2-install</a></li> <li><a id="toc-Making-a-GRUB-bootable-CD_002dROM-1" href="#Making-a-GRUB-bootable-CD_002dROM">4.2 Making a GRUB bootable CD-ROM</a></li> <li><a id="toc-The-map-between-BIOS-drives-and-OS-devices" href="#Device-map">4.3 The map between BIOS drives and OS devices</a></li> <li><a id="toc-BIOS-installation-1" href="#BIOS-installation">4.4 BIOS installation</a></li> </ul></li> <li><a id="toc-Booting-1" href="#Booting">5 Booting</a> <ul class="toc-numbered-mark"> <li><a id="toc-How-to-boot-operating-systems" href="#General-boot-methods">5.1 How to boot operating systems</a> <ul class="toc-numbered-mark"> <li><a id="toc-How-to-boot-an-OS-directly-with-GRUB" href="#Loading-an-operating-system-directly">5.1.1 How to boot an OS directly with GRUB</a></li> <li><a id="toc-Kexec-with-grub2_002demu" href="#Kexec">5.1.2 Kexec with grub2-emu</a></li> <li><a id="toc-Chain_002dloading-an-OS" href="#Chain_002dloading">5.1.3 Chain-loading an OS</a></li> </ul></li> <li><a id="toc-Loopback-booting-1" href="#Loopback-booting">5.2 Loopback booting</a></li> <li><a id="toc-Booting-from-LVM-cache-logical-volume" href="#LVM-cache-booting">5.3 Booting from LVM cache logical volume</a></li> <li><a id="toc-Some-caveats-on-OS_002dspecific-issues" href="#OS_002dspecific-notes">5.4 Some caveats on OS-specific issues</a> <ul class="toc-numbered-mark"> <li><a id="toc-GNU_002fHurd-1" href="#GNU_002fHurd">5.4.1 GNU/Hurd</a></li> <li><a id="toc-GNU_002fLinux-1" href="#GNU_002fLinux">5.4.2 GNU/Linux</a></li> <li><a id="toc-NetBSD-1" href="#NetBSD">5.4.3 NetBSD</a></li> <li><a id="toc-DOS_002fWindows-1" href="#DOS_002fWindows">5.4.4 DOS/Windows</a></li> </ul></li> </ul></li> <li><a id="toc-Writing-your-own-configuration-file" href="#Configuration">6 Writing your own configuration file</a> <ul class="toc-numbered-mark"> <li><a id="toc-Simple-configuration-handling" href="#Simple-configuration">6.1 Simple configuration handling</a></li> <li><a id="toc-Root-Identifcation-Heuristics-1" href="#Root-Identifcation-Heuristics">6.2 Root Identifcation Heuristics</a></li> <li><a id="toc-Writing-full-configuration-files-directly" href="#Shell_002dlike-scripting">6.3 Writing full configuration files directly</a></li> <li><a id="toc-Multi_002dboot-manual-config-1" href="#Multi_002dboot-manual-config">6.4 Multi-boot manual config</a></li> <li><a id="toc-Embedding-a-configuration-file-into-GRUB" href="#Embedded-configuration">6.5 Embedding a configuration file into GRUB</a></li> </ul></li> <li><a id="toc-Theme-file-format-1" href="#Theme-file-format">7 Theme file format</a> <ul class="toc-numbered-mark"> <li><a id="toc-Introduction-1" href="#Introduction-1">7.1 Introduction</a></li> <li><a id="toc-Theme-Elements" href="#Theme-Elements">7.2 Theme Elements</a> <ul class="toc-numbered-mark"> <li><a id="toc-Colors" href="#Colors">7.2.1 Colors</a></li> <li><a id="toc-Fonts" href="#Fonts">7.2.2 Fonts</a></li> <li><a id="toc-Progress-Bar" href="#Progress-Bar">7.2.3 Progress Bar</a></li> <li><a id="toc-Circular-Progress-Indicator" href="#Circular-Progress-Indicator">7.2.4 Circular Progress Indicator</a></li> <li><a id="toc-Labels" href="#Labels">7.2.5 Labels</a></li> <li><a id="toc-Boot-Menu" href="#Boot-Menu">7.2.6 Boot Menu</a></li> <li><a id="toc-Styled-Boxes" href="#Styled-Boxes">7.2.7 Styled Boxes</a></li> <li><a id="toc-Creating-Styled-Box-Images" href="#Creating-Styled-Box-Images">7.2.8 Creating Styled Box Images</a></li> </ul></li> <li><a id="toc-Theme-File-Manual" href="#Theme-File-Manual">7.3 Theme File Manual</a> <ul class="toc-numbered-mark"> <li><a id="toc-Global-Properties" href="#Global-Properties">7.3.1 Global Properties</a></li> <li><a id="toc-Format" href="#Format">7.3.2 Format</a></li> <li><a id="toc-Global-Property-List" href="#Global-Property-List">7.3.3 Global Property List</a></li> <li><a id="toc-Component-Construction" href="#Component-Construction">7.3.4 Component Construction</a></li> <li><a id="toc-Component-List" href="#Component-List">7.3.5 Component List</a></li> <li><a id="toc-Common-properties" href="#Common-properties">7.3.6 Common properties</a></li> </ul></li> </ul></li> <li><a id="toc-Booting-GRUB-from-the-network" href="#Network">8 Booting GRUB from the network</a></li> <li><a id="toc-Using-GRUB-via-a-serial-line" href="#Serial-terminal">9 Using GRUB via a serial line</a></li> <li><a id="toc-Using-GRUB-with-vendor-power_002don-keys" href="#Vendor-power_002don-keys">10 Using GRUB with vendor power-on keys</a></li> <li><a id="toc-GRUB-image-files" href="#Images">11 GRUB image files</a></li> <li><a id="toc-Core-image-size-limitation-1" href="#Core-image-size-limitation">12 Core image size limitation</a></li> <li><a id="toc-Filesystem-syntax-and-semantics" href="#Filesystem">13 Filesystem syntax and semantics</a> <ul class="toc-numbered-mark"> <li><a id="toc-How-to-specify-devices" href="#Device-syntax">13.1 How to specify devices</a></li> <li><a id="toc-How-to-specify-files" href="#File-name-syntax">13.2 How to specify files</a></li> <li><a id="toc-How-to-specify-block-lists" href="#Block-list-syntax">13.3 How to specify block lists</a></li> </ul></li> <li><a id="toc-GRUB_0027s-user-interface" href="#Interface">14 GRUB’s user interface</a> <ul class="toc-numbered-mark"> <li><a id="toc-The-flexible-command_002dline-interface" href="#Command_002dline-interface">14.1 The flexible command-line interface</a></li> <li><a id="toc-The-simple-menu-interface" href="#Menu-interface">14.2 The simple menu interface</a></li> <li><a id="toc-Editing-a-menu-entry" href="#Menu-entry-editor">14.3 Editing a menu entry</a></li> </ul></li> <li><a id="toc-GRUB-environment-variables" href="#Environment">15 GRUB environment variables</a> <ul class="toc-numbered-mark"> <li><a id="toc-Special-environment-variables-1" href="#Special-environment-variables">15.1 Special environment variables</a> <ul class="toc-numbered-mark"> <li><a id="toc-biosnum-1" href="#biosnum">15.1.1 biosnum</a></li> <li><a id="toc-check_005fappended_005fsignatures-1" href="#check_005fappended_005fsignatures">15.1.2 check_appended_signatures</a></li> <li><a id="toc-check_005fsignatures-1" href="#check_005fsignatures">15.1.3 check_signatures</a></li> <li><a id="toc-chosen-1" href="#chosen">15.1.4 chosen</a></li> <li><a id="toc-cmdpath-1" href="#cmdpath">15.1.5 cmdpath</a></li> <li><a id="toc-color_005fhighlight-1" href="#color_005fhighlight">15.1.6 color_highlight</a></li> <li><a id="toc-color_005fnormal-1" href="#color_005fnormal">15.1.7 color_normal</a></li> <li><a id="toc-config_005fdirectory-1" href="#config_005fdirectory">15.1.8 config_directory</a></li> <li><a id="toc-config_005ffile-1" href="#config_005ffile">15.1.9 config_file</a></li> <li><a id="toc-debug-1" href="#debug">15.1.10 debug</a></li> <li><a id="toc-default-1" href="#default">15.1.11 default</a></li> <li><a id="toc-fallback-1" href="#fallback">15.1.12 fallback</a></li> <li><a id="toc-gfxmode-1" href="#gfxmode">15.1.13 gfxmode</a></li> <li><a id="toc-gfxpayload-1" href="#gfxpayload">15.1.14 gfxpayload</a></li> <li><a id="toc-gfxterm_005ffont-1" href="#gfxterm_005ffont">15.1.15 gfxterm_font</a></li> <li><a id="toc-grub_005fcpu-1" href="#grub_005fcpu">15.1.16 grub_cpu</a></li> <li><a id="toc-grub_005fplatform-1" href="#grub_005fplatform">15.1.17 grub_platform</a></li> <li><a id="toc-icondir-1" href="#icondir">15.1.18 icondir</a></li> <li><a id="toc-lang-1" href="#lang">15.1.19 lang</a></li> <li><a id="toc-locale_005fdir-1" href="#locale_005fdir">15.1.20 locale_dir</a></li> <li><a id="toc-lockdown-1" href="#lockdown">15.1.21 lockdown</a></li> <li><a id="toc-menu_005fcolor_005fhighlight-1" href="#menu_005fcolor_005fhighlight">15.1.22 menu_color_highlight</a></li> <li><a id="toc-menu_005fcolor_005fnormal-1" href="#menu_005fcolor_005fnormal">15.1.23 menu_color_normal</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fboot_005ffile-1" href="#net_005f_003cinterface_003e_005fboot_005ffile">15.1.24 net_<var class="var"><interface></var>_boot_file</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fclientid-1" href="#net_005f_003cinterface_003e_005fclientid">15.1.25 net_<var class="var"><interface></var>_clientid</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fclientuuid-1" href="#net_005f_003cinterface_003e_005fclientuuid">15.1.26 net_<var class="var"><interface></var>_clientuuid</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fdhcp_005fserver_005fname-1" href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname">15.1.27 net_<var class="var"><interface></var>_dhcp_server_name</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fdomain-1" href="#net_005f_003cinterface_003e_005fdomain">15.1.28 net_<var class="var"><interface></var>_domain</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fextensionspath-1" href="#net_005f_003cinterface_003e_005fextensionspath">15.1.29 net_<var class="var"><interface></var>_extensionspath</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fhostname-1" href="#net_005f_003cinterface_003e_005fhostname">15.1.30 net_<var class="var"><interface></var>_hostname</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fip-1" href="#net_005f_003cinterface_003e_005fip">15.1.31 net_<var class="var"><interface></var>_ip</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fmac-1" href="#net_005f_003cinterface_003e_005fmac">15.1.32 net_<var class="var"><interface></var>_mac</a></li> <li><a id="toc-net_005f_003cinterface_003e_005fnext_005fserver-1" href="#net_005f_003cinterface_003e_005fnext_005fserver">15.1.33 net_<var class="var"><interface></var>_next_server</a></li> <li><a id="toc-net_005f_003cinterface_003e_005frootpath-1" href="#net_005f_003cinterface_003e_005frootpath">15.1.34 net_<var class="var"><interface></var>_rootpath</a></li> <li><a id="toc-net_005fdefault_005finterface-1" href="#net_005fdefault_005finterface">15.1.35 net_default_interface</a></li> <li><a id="toc-net_005fdefault_005fip-1" href="#net_005fdefault_005fip">15.1.36 net_default_ip</a></li> <li><a id="toc-net_005fdefault_005fmac-1" href="#net_005fdefault_005fmac">15.1.37 net_default_mac</a></li> <li><a id="toc-net_005fdefault_005fserver-1" href="#net_005fdefault_005fserver">15.1.38 net_default_server</a></li> <li><a id="toc-pager-1" href="#pager">15.1.39 pager</a></li> <li><a id="toc-prefix-1" href="#prefix">15.1.40 prefix</a></li> <li><a id="toc-pxe_005fblksize-1" href="#pxe_005fblksize">15.1.41 pxe_blksize</a></li> <li><a id="toc-pxe_005fdefault_005fgateway-1" href="#pxe_005fdefault_005fgateway">15.1.42 pxe_default_gateway</a></li> <li><a id="toc-pxe_005fdefault_005fserver-1" href="#pxe_005fdefault_005fserver">15.1.43 pxe_default_server</a></li> <li><a id="toc-root-1" href="#root">15.1.44 root</a></li> <li><a id="toc-shim_005flock-1" href="#shim_005flock">15.1.45 shim_lock</a></li> <li><a id="toc-superusers-1" href="#superusers">15.1.46 superusers</a></li> <li><a id="toc-theme-1" href="#theme">15.1.47 theme</a></li> <li><a id="toc-timeout-1" href="#timeout">15.1.48 timeout</a></li> <li><a id="toc-timeout_005fstyle-1" href="#timeout_005fstyle">15.1.49 timeout_style</a></li> <li><a id="toc-tpm_005ffail_005ffatal-1" href="#tpm_005ffail_005ffatal">15.1.50 tpm_fail_fatal</a></li> </ul></li> <li><a id="toc-The-GRUB-environment-block" href="#Environment-block">15.2 The GRUB environment block</a></li> </ul></li> <li><a id="toc-Modules-1" href="#Modules">16 Modules</a> <ul class="toc-numbered-mark"> <li><a id="toc-bli-1" href="#bli">16.1 bli</a></li> </ul></li> <li><a id="toc-Available-commands" href="#Commands">17 Available commands</a> <ul class="toc-numbered-mark"> <li><a id="toc-Commands-for-the-menu-only" href="#Menu_002dspecific-commands">17.1 Commands for the menu only</a> <ul class="toc-numbered-mark"> <li><a id="toc-menuentry-1" href="#menuentry">17.1.1 menuentry</a></li> <li><a id="toc-submenu-1" href="#submenu">17.1.2 submenu</a></li> </ul></li> <li><a id="toc-Various-loader-commands" href="#Loader-commands">17.2 Various loader commands</a> <ul class="toc-numbered-mark"> <li><a id="toc-chainloader-1" href="#chainloader">17.2.1 chainloader</a></li> <li><a id="toc-initrd-1" href="#initrd">17.2.2 initrd</a></li> <li><a id="toc-initrd16-1" href="#initrd16">17.2.3 initrd16</a></li> <li><a id="toc-linux-1" href="#linux">17.2.4 linux</a></li> <li><a id="toc-linux16-1" href="#linux16">17.2.5 linux16</a></li> <li><a id="toc-xen_005fhypervisor-1" href="#xen_005fhypervisor">17.2.6 xen_hypervisor</a></li> <li><a id="toc-xen_005fmodule-1" href="#xen_005fmodule">17.2.7 xen_module</a></li> </ul></li> <li><a id="toc-General-commands-1" href="#General-commands">17.3 General commands</a> <ul class="toc-numbered-mark"> <li><a id="toc-serial-1" href="#serial">17.3.1 serial</a></li> <li><a id="toc-terminal_005finput-1" href="#terminal_005finput">17.3.2 terminal_input</a></li> <li><a id="toc-terminal_005foutput-1" href="#terminal_005foutput">17.3.3 terminal_output</a></li> <li><a id="toc-terminfo-1" href="#terminfo">17.3.4 terminfo</a></li> </ul></li> <li><a id="toc-Command_002dline-commands-1" href="#Command_002dline-commands">17.4 Command-line commands</a> <ul class="toc-numbered-mark"> <li><a id="toc-_005b-1" href="#g_t_005b">17.4.1 [</a></li> <li><a id="toc-acpi-1" href="#acpi">17.4.2 acpi</a></li> <li><a id="toc-authenticate-1" href="#authenticate">17.4.3 authenticate</a></li> <li><a id="toc-background_005fcolor-1" href="#background_005fcolor">17.4.4 background_color</a></li> <li><a id="toc-background_005fimage-1" href="#background_005fimage">17.4.5 background_image</a></li> <li><a id="toc-badram-1" href="#badram">17.4.6 badram</a></li> <li><a id="toc-blocklist-1" href="#blocklist">17.4.7 blocklist</a></li> <li><a id="toc-boot-1" href="#boot">17.4.8 boot</a></li> <li><a id="toc-cat-1" href="#cat">17.4.9 cat</a></li> <li><a id="toc-clear-1" href="#clear">17.4.10 clear</a></li> <li><a id="toc-cmosclean-1" href="#cmosclean">17.4.11 cmosclean</a></li> <li><a id="toc-cmosdump-1" href="#cmosdump">17.4.12 cmosdump</a></li> <li><a id="toc-cmostest-1" href="#cmostest">17.4.13 cmostest</a></li> <li><a id="toc-cmp-1" href="#cmp">17.4.14 cmp</a></li> <li><a id="toc-configfile-1" href="#configfile">17.4.15 configfile</a></li> <li><a id="toc-cpuid-1" href="#cpuid">17.4.16 cpuid</a></li> <li><a id="toc-crc-1" href="#crc">17.4.17 crc</a></li> <li><a id="toc-cryptomount-1" href="#cryptomount">17.4.18 cryptomount</a></li> <li><a id="toc-cutmem-1" href="#cutmem">17.4.19 cutmem</a></li> <li><a id="toc-date-1" href="#date">17.4.20 date</a></li> <li><a id="toc-devicetree-1" href="#devicetree">17.4.21 devicetree</a></li> <li><a id="toc-distrust-1" href="#distrust">17.4.22 distrust</a></li> <li><a id="toc-distrust_005fcertificate-1" href="#distrust_005fcertificate">17.4.23 distrust_certificate</a></li> <li><a id="toc-drivemap-1" href="#drivemap">17.4.24 drivemap</a></li> <li><a id="toc-echo-1" href="#echo">17.4.25 echo</a></li> <li><a id="toc-efitextmode-1" href="#efitextmode">17.4.26 efitextmode</a></li> <li><a id="toc-eval-1" href="#eval">17.4.27 eval</a></li> <li><a id="toc-export-1" href="#export">17.4.28 export</a></li> <li><a id="toc-false-1" href="#false">17.4.29 false</a></li> <li><a id="toc-fwsetup-1" href="#fwsetup">17.4.30 fwsetup</a></li> <li><a id="toc-gdbinfo-1" href="#gdbinfo">17.4.31 gdbinfo</a></li> <li><a id="toc-gettext-1" href="#gettext">17.4.32 gettext</a></li> <li><a id="toc-gptsync-1" href="#gptsync">17.4.33 gptsync</a></li> <li><a id="toc-halt-1" href="#halt">17.4.34 halt</a></li> <li><a id="toc-hashsum-1" href="#hashsum">17.4.35 hashsum</a></li> <li><a id="toc-help-1" href="#help">17.4.36 help</a></li> <li><a id="toc-hexdump-1" href="#hexdump">17.4.37 hexdump</a></li> <li><a id="toc-insmod-1" href="#insmod">17.4.38 insmod</a></li> <li><a id="toc-keystatus-1" href="#keystatus">17.4.39 keystatus</a></li> <li><a id="toc-list_005fcertificates-1" href="#list_005fcertificates">17.4.40 list_certificates</a></li> <li><a id="toc-list_005fenv-1" href="#list_005fenv">17.4.41 list_env</a></li> <li><a id="toc-list_005ftrusted-1" href="#list_005ftrusted">17.4.42 list_trusted</a></li> <li><a id="toc-load_005fenv-1" href="#load_005fenv">17.4.43 load_env</a></li> <li><a id="toc-loadfont-1" href="#loadfont">17.4.44 loadfont</a></li> <li><a id="toc-loopback-1" href="#loopback">17.4.45 loopback</a></li> <li><a id="toc-ls-1" href="#ls">17.4.46 ls</a></li> <li><a id="toc-lsfonts-1" href="#lsfonts">17.4.47 lsfonts</a></li> <li><a id="toc-lsmod-1" href="#lsmod">17.4.48 lsmod</a></li> <li><a id="toc-md5sum-1" href="#md5sum">17.4.49 md5sum</a></li> <li><a id="toc-module-1" href="#module">17.4.50 module</a></li> <li><a id="toc-multiboot-1" href="#multiboot">17.4.51 multiboot</a></li> <li><a id="toc-nativedisk-1" href="#nativedisk">17.4.52 nativedisk</a></li> <li><a id="toc-normal-1" href="#normal">17.4.53 normal</a></li> <li><a id="toc-normal_005fexit-1" href="#normal_005fexit">17.4.54 normal_exit</a></li> <li><a id="toc-parttool-1" href="#parttool">17.4.55 parttool</a></li> <li><a id="toc-password-1" href="#password">17.4.56 password</a></li> <li><a id="toc-password_005fpbkdf2-1" href="#password_005fpbkdf2">17.4.57 password_pbkdf2</a></li> <li><a id="toc-plainmount-1" href="#plainmount">17.4.58 plainmount</a></li> <li><a id="toc-play-1" href="#play">17.4.59 play</a></li> <li><a id="toc-probe-1" href="#probe">17.4.60 probe</a></li> <li><a id="toc-rdmsr-1" href="#rdmsr">17.4.61 rdmsr</a></li> <li><a id="toc-read-1" href="#read">17.4.62 read</a></li> <li><a id="toc-reboot-1" href="#reboot">17.4.63 reboot</a></li> <li><a id="toc-regexp-1" href="#regexp">17.4.64 regexp</a></li> <li><a id="toc-rmmod-1" href="#rmmod">17.4.65 rmmod</a></li> <li><a id="toc-save_005fenv-1" href="#save_005fenv">17.4.66 save_env</a></li> <li><a id="toc-search-1" href="#search">17.4.67 search</a></li> <li><a id="toc-sendkey-1" href="#sendkey">17.4.68 sendkey</a></li> <li><a id="toc-set-1" href="#set">17.4.69 set</a></li> <li><a id="toc-sha1sum-1" href="#sha1sum">17.4.70 sha1sum</a></li> <li><a id="toc-sha256sum-1" href="#sha256sum">17.4.71 sha256sum</a></li> <li><a id="toc-sha512sum-1" href="#sha512sum">17.4.72 sha512sum</a></li> <li><a id="toc-sleep-1" href="#sleep">17.4.73 sleep</a></li> <li><a id="toc-smbios-1" href="#smbios">17.4.74 smbios</a></li> <li><a id="toc-source-1" href="#source">17.4.75 source</a></li> <li><a id="toc-test-1" href="#test">17.4.76 test</a></li> <li><a id="toc-true-1" href="#true">17.4.77 true</a></li> <li><a id="toc-trust-1" href="#trust">17.4.78 trust</a></li> <li><a id="toc-trust_005fcertificate-1" href="#trust_005fcertificate">17.4.79 trust_certificate</a></li> <li><a id="toc-unset-1" href="#unset">17.4.80 unset</a></li> <li><a id="toc-verify_005fappended-1" href="#verify_005fappended">17.4.81 verify_appended</a></li> <li><a id="toc-verify_005fdetached-1" href="#verify_005fdetached">17.4.82 verify_detached</a></li> <li><a id="toc-videoinfo-1" href="#videoinfo">17.4.83 videoinfo</a></li> <li><a id="toc-wrmsr-1" href="#wrmsr">17.4.84 wrmsr</a></li> </ul></li> <li><a id="toc-Networking-commands-1" href="#Networking-commands">17.5 Networking commands</a> <ul class="toc-numbered-mark"> <li><a id="toc-net_005fadd_005faddr-1" href="#net_005fadd_005faddr">17.5.1 net_add_addr</a></li> <li><a id="toc-net_005fadd_005fdns-1" href="#net_005fadd_005fdns">17.5.2 net_add_dns</a></li> <li><a id="toc-net_005fadd_005froute-1" href="#net_005fadd_005froute">17.5.3 net_add_route</a></li> <li><a id="toc-net_005fbootp-1" href="#net_005fbootp">17.5.4 net_bootp</a></li> <li><a id="toc-net_005fdel_005faddr-1" href="#net_005fdel_005faddr">17.5.5 net_del_addr</a></li> <li><a id="toc-net_005fdel_005fdns-1" href="#net_005fdel_005fdns">17.5.6 net_del_dns</a></li> <li><a id="toc-net_005fdel_005froute-1" href="#net_005fdel_005froute">17.5.7 net_del_route</a></li> <li><a id="toc-net_005fdhcp-1" href="#net_005fdhcp">17.5.8 net_dhcp</a></li> <li><a id="toc-net_005fbootp6-1" href="#net_005fbootp6">17.5.9 net_bootp6</a></li> <li><a id="toc-net_005fget_005fdhcp_005foption-1" href="#net_005fget_005fdhcp_005foption">17.5.10 net_get_dhcp_option</a></li> <li><a id="toc-net_005fipv6_005fautoconf-1" href="#net_005fipv6_005fautoconf">17.5.11 net_ipv6_autoconf</a></li> <li><a id="toc-net_005fls_005faddr-1" href="#net_005fls_005faddr">17.5.12 net_ls_addr</a></li> <li><a id="toc-net_005fls_005fcards-1" href="#net_005fls_005fcards">17.5.13 net_ls_cards</a></li> <li><a id="toc-net_005fls_005fdns-1" href="#net_005fls_005fdns">17.5.14 net_ls_dns</a></li> <li><a id="toc-net_005fls_005froutes-1" href="#net_005fls_005froutes">17.5.15 net_ls_routes</a></li> <li><a id="toc-net_005fnslookup-1" href="#net_005fnslookup">17.5.16 net_nslookup</a></li> <li><a id="toc-net_005fset_005fvlan-1" href="#net_005fset_005fvlan">17.5.17 net_set_vlan</a></li> </ul></li> <li><a id="toc-Commands-currently-undocumented" href="#Undocumented-commands">17.6 Commands currently undocumented</a></li> </ul></li> <li><a id="toc-Internationalisation-1" href="#Internationalisation">18 Internationalisation</a> <ul class="toc-numbered-mark"> <li><a id="toc-Charset" href="#Charset">18.1 Charset</a></li> <li><a id="toc-Filesystems" href="#Filesystems">18.2 Filesystems</a></li> <li><a id="toc-Output-terminal" href="#Output-terminal">18.3 Output terminal</a></li> <li><a id="toc-Input-terminal" href="#Input-terminal">18.4 Input terminal</a></li> <li><a id="toc-Gettext" href="#Gettext">18.5 Gettext</a></li> <li><a id="toc-Regexp" href="#Regexp">18.6 Regexp</a></li> <li><a id="toc-Other" href="#Other">18.7 Other</a></li> </ul></li> <li><a id="toc-Security-1" href="#Security">19 Security</a> <ul class="toc-numbered-mark"> <li><a id="toc-Authentication-and-authorisation-in-GRUB" href="#Authentication-and-authorisation">19.1 Authentication and authorisation in GRUB</a></li> <li><a id="toc-Using-GPG_002dstyle-digital-signatures-in-GRUB" href="#Using-GPG_002dstyle-digital-signatures">19.2 Using GPG-style digital signatures in GRUB</a></li> <li><a id="toc-Using-appended-signatures-in-GRUB" href="#Using-appended-signatures">19.3 Using appended signatures in GRUB</a></li> <li><a id="toc-UEFI-secure-boot-and-shim-support" href="#UEFI-secure-boot-and-shim">19.4 UEFI secure boot and shim support</a></li> <li><a id="toc-Embedded-information-for-generation-number-based-revocation" href="#Secure-Boot-Advanced-Targeting">19.5 Embedded information for generation number based revocation</a></li> <li><a id="toc-Measuring-boot-components" href="#Measured-Boot">19.6 Measuring boot components</a></li> <li><a id="toc-Lockdown-when-booting-on-a-secure-setup" href="#Lockdown">19.7 Lockdown when booting on a secure setup</a></li> <li><a id="toc-Signing-GRUB-itself-1" href="#Signing-GRUB-itself">19.8 Signing GRUB itself</a></li> <li><a id="toc-Signing-GRUB-for-UEFI-secure-boot" href="#Signing-GRUB-for-UEFI-secure-boot">19.9 Signing GRUB for UEFI secure boot</a></li> <li><a id="toc-Signing-GRUB-with-an-appended-signature" href="#Signing-GRUB-with-an-appended-signature">19.10 Signing GRUB with an appended signature</a> <ul class="toc-numbered-mark"> <li><a id="toc-Command-line-and-menuentry-editor-protection" href="#Command-line-and-menuentry-editor-protection">19.10.1 Command line and menuentry editor protection</a></li> </ul></li> </ul></li> <li><a id="toc-Platform-limitations-1" href="#Platform-limitations">20 Platform limitations</a></li> <li><a id="toc-Outline" href="#Platform_002dspecific-operations">21 Outline</a></li> <li><a id="toc-Supported-boot-targets" href="#Supported-kernels">22 Supported boot targets</a> <ul class="toc-numbered-mark"> <li><a id="toc-Boot-tests" href="#Boot-tests">22.1 Boot tests</a></li> </ul></li> <li><a id="toc-Error-messages-produced-by-GRUB" href="#Troubleshooting">23 Error messages produced by GRUB</a> <ul class="toc-numbered-mark"> <li><a id="toc-GRUB-only-offers-a-rescue-shell-1" href="#GRUB-only-offers-a-rescue-shell">23.1 GRUB only offers a rescue shell</a></li> <li><a id="toc-Firmware-stalls-instead-of-booting-GRUB-1" href="#Firmware-stalls-instead-of-booting-GRUB">23.2 Firmware stalls instead of booting GRUB</a></li> </ul></li> <li><a id="toc-User_002dspace-utilities-1" href="#User_002dspace-utilities">24 User-space utilities</a> <ul class="toc-numbered-mark"> <li><a id="toc-Invoking-grub2_002dinstall-1" href="#Invoking-grub2_002dinstall">24.1 Invoking grub2-install</a></li> <li><a id="toc-Invoking-grub2_002dmkconfig-1" href="#Invoking-grub2_002dmkconfig">24.2 Invoking grub2-mkconfig</a></li> <li><a id="toc-Invoking-grub2_002dmkpasswd_002dpbkdf2-1" href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">24.3 Invoking grub2-mkpasswd-pbkdf2</a></li> <li><a id="toc-Invoking-grub2_002dmkrelpath-1" href="#Invoking-grub2_002dmkrelpath">24.4 Invoking grub2-mkrelpath</a></li> <li><a id="toc-Invoking-grub2_002dmkrescue-1" href="#Invoking-grub2_002dmkrescue">24.5 Invoking grub2-mkrescue</a></li> <li><a id="toc-Invoking-grub2_002dmount-1" href="#Invoking-grub2_002dmount">24.6 Invoking grub2-mount</a></li> <li><a id="toc-Invoking-grub2_002dprobe-1" href="#Invoking-grub2_002dprobe">24.7 Invoking grub2-probe</a></li> <li><a id="toc-Invoking-grub2_002dscript_002dcheck-1" href="#Invoking-grub2_002dscript_002dcheck">24.8 Invoking grub2-script-check</a></li> </ul></li> <li><a id="toc-How-to-obtain-and-build-GRUB" href="#Obtaining-and-Building-GRUB">Appendix A How to obtain and build GRUB</a></li> <li><a id="toc-Reporting-bugs-1" href="#Reporting-bugs">Appendix B Reporting bugs</a></li> <li><a id="toc-Where-GRUB-will-go" href="#Future">Appendix C Where GRUB will go</a></li> <li><a id="toc-Copying-This-Manual-1" href="#Copying-This-Manual">Appendix D Copying This Manual</a> <ul class="toc-numbered-mark"> <li><a id="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">D.1 GNU Free Documentation License</a> <ul class="toc-numbered-mark"> <li><a id="toc-ADDENDUM_003a-How-to-use-this-License-for-your-documents" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents">D.1.1 ADDENDUM: How to use this License for your documents</a></li> </ul></li> </ul></li> <li><a id="toc-Index-1" href="#Index" rel="index">Index</a></li> </ul> </div> </div> <hr> <div class="chapter-level-extent" id="Introduction"> <div class="nav-panel"> <p> Next: <a href="#Naming-convention" accesskey="n" rel="next">Naming convention</a>, Previous: <a href="#Top" accesskey="p" rel="prev">GNU GRUB manual</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Introduction-to-GRUB"><span>1 Introduction to GRUB<a class="copiable-link" href="#Introduction-to-GRUB"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#Overview" accesskey="1">Overview</a></li> <li><a href="#History" accesskey="2">History of GRUB</a></li> <li><a href="#Changes-from-GRUB-Legacy" accesskey="3">Differences from previous versions</a></li> <li><a href="#Features" accesskey="4">GRUB features</a></li> <li><a href="#Role-of-a-boot-loader" accesskey="5">The role of a boot loader</a></li> </ul> <hr> <div class="section-level-extent" id="Overview"> <div class="nav-panel"> <p> Next: <a href="#History" accesskey="n" rel="next">History of GRUB</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Overview-1"><span>1.1 Overview<a class="copiable-link" href="#Overview-1"> ¶</a></span></h3> <p>Briefly, a <em class="dfn">boot loader</em> is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system <em class="dfn">kernel</em> software (such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system). </p> <p>GNU GRUB is a very powerful boot loader, which can load a wide variety of free operating systems, as well as proprietary operating systems with chain-loading<a class="footnote" id="DOCF1" href="#FOOT1"><sup>1</sup></a>. GRUB is designed to address the complexity of booting a personal computer; both the program and this manual are tightly bound to that computer platform, although porting to other platforms may be addressed in the future. </p> <p>One of the important features in GRUB is flexibility; GRUB understands filesystems and kernel executable formats, so you can load an arbitrary operating system the way you like, without recording the physical position of your kernel on the disk. Thus you can load the kernel just by specifying its file name and the drive and partition where the kernel resides. </p> <p>When booting with GRUB, you can use either a command-line interface (see <a class="pxref" href="#Command_002dline-interface">The flexible command-line interface</a>), or a menu interface (see <a class="pxref" href="#Menu-interface">The simple menu interface</a>). Using the command-line interface, you type the drive specification and file name of the kernel manually. In the menu interface, you just select an OS using the arrow keys. The menu is based on a configuration file which you prepare beforehand (see <a class="pxref" href="#Configuration">Writing your own configuration file</a>). While in the menu, you can switch to the command-line mode, and vice-versa. You can even edit menu entries before using them. </p> <p>In the following chapters, you will learn how to specify a drive, a partition, and a file name (see <a class="pxref" href="#Naming-convention">Naming convention</a>) to GRUB, how to install GRUB on your drive (see <a class="pxref" href="#Installation">Installation</a>), and how to boot your OSes (see <a class="pxref" href="#Booting">Booting</a>), step by step. </p> <hr> </div> <div class="section-level-extent" id="History"> <div class="nav-panel"> <p> Next: <a href="#Changes-from-GRUB-Legacy" accesskey="n" rel="next">Differences from previous versions</a>, Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="History-of-GRUB"><span>1.2 History of GRUB<a class="copiable-link" href="#History-of-GRUB"> ¶</a></span></h3> <p>GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU Hurd with the University of Utah’s Mach 4 microkernel (now known as GNU Mach). Erich and Brian Ford designed the Multiboot Specification (see <a data-manual="multiboot" href="https://www.gnu.org/software/grub/manual//multiboot/multiboot.html#Top">Motivation</a> in <cite class="cite">The Multiboot Specification</cite>), because they were determined not to add to the large number of mutually-incompatible PC boot methods. </p> <p>Erich then began modifying the FreeBSD boot loader so that it would understand Multiboot. He soon realized that it would be a lot easier to write his own boot loader from scratch than to keep working on the FreeBSD boot loader, and so GRUB was born. </p> <p>Erich added many features to GRUB, but other priorities prevented him from keeping up with the demands of its quickly-expanding user base. In 1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an official GNU package, and opened its development by making the latest sources available via anonymous CVS. See <a class="xref" href="#Obtaining-and-Building-GRUB">How to obtain and build GRUB</a>, for more information. </p> <p>Over the next few years, GRUB was extended to meet many needs, but it quickly became clear that its design was not keeping up with the extensions being made to it, and we reached the point where it was very difficult to make any further changes without breaking existing features. Around 2002, Yoshinori K. Okuji started work on PUPA (Preliminary Universal Programming Architecture for GNU GRUB), aiming to rewrite the core of GRUB to make it cleaner, safer, more robust, and more powerful. PUPA was eventually renamed to GRUB 2, and the original version of GRUB was renamed to GRUB Legacy. Small amounts of maintenance continued to be done on GRUB Legacy, but the last release (0.97) was made in 2005 and at the time of writing it seems unlikely that there will be another. </p> <p>By around 2007, GNU/Linux distributions started to use GRUB 2 to limited extents, and by the end of 2009 multiple major distributions were installing it by default. </p> <hr> </div> <div class="section-level-extent" id="Changes-from-GRUB-Legacy"> <div class="nav-panel"> <p> Next: <a href="#Features" accesskey="n" rel="next">GRUB features</a>, Previous: <a href="#History" accesskey="p" rel="prev">History of GRUB</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Differences-from-previous-versions"><span>1.3 Differences from previous versions<a class="copiable-link" href="#Differences-from-previous-versions"> ¶</a></span></h3> <p>GRUB 2 is a rewrite of GRUB (see <a class="pxref" href="#History">History of GRUB</a>), although it shares many characteristics with the previous version, now known as GRUB Legacy. Users of GRUB Legacy may need some guidance to find their way around this new version. </p> <ul class="itemize mark-bullet"> <li>The configuration file has a new name (<samp class="file">grub.cfg</samp> rather than <samp class="file">menu.lst</samp> or <samp class="file">grub.conf</samp>), new syntax (see <a class="pxref" href="#Configuration">Writing your own configuration file</a>) and many new commands (see <a class="pxref" href="#Commands">Available commands</a>). Configuration cannot be copied over directly, although most GRUB Legacy users should not find the syntax too surprising. </li><li><samp class="file">grub.cfg</samp> is typically automatically generated by <code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). This makes it easier to handle versioned kernel upgrades. </li><li>Partition numbers in GRUB device names now start at 1, not 0 (see <a class="pxref" href="#Naming-convention">Naming convention</a>). </li><li>The configuration file is now written in something closer to a full scripting language: variables, conditionals, and loops are available. </li><li>A small amount of persistent storage is available across reboots, using the <code class="command">save_env</code> and <code class="command">load_env</code> commands in GRUB and the <code class="command">grub2-editenv</code> utility. This is not available in all configurations (see <a class="pxref" href="#Environment-block">The GRUB environment block</a>). </li><li>GRUB 2 has more reliable ways to find its own files and those of target kernels on multiple-disk systems, and has commands (see <a class="pxref" href="#search">search</a>) to find devices using file system labels or Universally Unique Identifiers (UUIDs). </li><li>GRUB 2 is available for several other types of system in addition to the PC BIOS systems supported by GRUB Legacy: PC EFI, PC coreboot, PowerPC, SPARC, and MIPS Lemote Yeeloong are all supported. </li><li>Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS. </li><li>GRUB 2 can read files directly from LVM and RAID devices. </li><li>A graphical terminal and a graphical menu system are available. </li><li>GRUB 2’s interface can be translated, including menu entry names. </li><li>The image files (see <a class="pxref" href="#Images">GRUB image files</a>) that make up GRUB have been reorganised; Stage 1, Stage 1.5, and Stage 2 are no more. </li><li>GRUB 2 puts many facilities in dynamically loaded modules, allowing the core image to be smaller, and allowing the core image to be built in more flexible ways. </li></ul> <hr> </div> <div class="section-level-extent" id="Features"> <div class="nav-panel"> <p> Next: <a href="#Role-of-a-boot-loader" accesskey="n" rel="next">The role of a boot loader</a>, Previous: <a href="#Changes-from-GRUB-Legacy" accesskey="p" rel="prev">Differences from previous versions</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="GRUB-features"><span>1.4 GRUB features<a class="copiable-link" href="#GRUB-features"> ¶</a></span></h3> <p>The primary requirement for GRUB is that it be compliant with the <em class="dfn">Multiboot Specification</em>, which is described in <a data-manual="multiboot" href="https://www.gnu.org/software/grub/manual//multiboot/multiboot.html#Top">Motivation</a> in <cite class="cite">The Multiboot Specification</cite>. </p> <p>The other goals, listed in approximate order of importance, are: </p> <ul class="itemize mark-bullet"> <li>Basic functions must be straightforward for end-users. </li><li>Rich functionality to support kernel experts and designers. </li><li>Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are supported via a chain-loading function. </li></ul> <p>Except for specific compatibility modes (chain-loading and the Linux <em class="dfn">piggyback</em> format), all kernels will be started in much the same state as in the Multiboot Specification. Only kernels loaded at 1 megabyte or above are presently supported. Any attempt to load below that boundary will simply result in immediate failure and an error message reporting the problem. </p> <p>In addition to the requirements above, GRUB has the following features (note that the Multiboot Specification doesn’t require all the features that GRUB supports): </p> <dl class="table"> <dt>Recognize multiple executable formats</dt> <dd><p>Support many of the <em class="dfn">a.out</em> variants plus <em class="dfn">ELF</em>. Symbol tables are also loaded. </p> </dd> <dt>Support non-Multiboot kernels</dt> <dd><p>Support many of the various free 32-bit kernels that lack Multiboot compliance (primarily FreeBSD, NetBSD<a class="footnote" id="DOCF2" href="#FOOT2"><sup>2</sup></a>, OpenBSD, and Linux). Chain-loading of other boot loaders is also supported. </p> </dd> <dt>Load multiples modules</dt> <dd><p>Fully support the Multiboot feature of loading multiple modules. </p> </dd> <dt>Load a configuration file</dt> <dd><p>Support a human-readable text configuration file with preset boot commands. You can also load another configuration file dynamically and embed a preset configuration file in a GRUB image file. The list of commands (see <a class="pxref" href="#Commands">Available commands</a>) are a superset of those supported on the command-line. An example configuration file is provided in <a class="ref" href="#Configuration">Writing your own configuration file</a>. </p> </dd> <dt>Provide a menu interface</dt> <dd><p>A menu interface listing preset boot commands, with a programmable timeout, is available. There is no fixed limit on the number of boot entries, and the current implementation has space for several hundred. </p> </dd> <dt>Have a flexible command-line interface</dt> <dd><p>A fairly flexible command-line interface, accessible from the menu, is available to edit any preset commands, or write a new boot command set from scratch. If no configuration file is present, GRUB drops to the command-line. </p> <p>The list of commands (see <a class="pxref" href="#Commands">Available commands</a>) are a subset of those supported for configuration files. Editing commands closely resembles the Bash command-line (see <a data-manual="features" href="features.html#Command-Line-Editing">Command Line Editing</a> in <cite class="cite">Bash Features</cite>), with <kbd class="key">TAB</kbd>-completion of commands, devices, partitions, and files in a directory depending on context. </p> </dd> <dt>Support multiple filesystem types</dt> <dd><p>Support multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are <em class="dfn">Amiga Fast FileSystem (AFFS)</em>, <em class="dfn">AtheOS fs</em>, <em class="dfn">BeFS</em>, <em class="dfn">BtrFS</em> (including raid0, raid1, raid10, gzip and lzo), <em class="dfn">cpio</em> (little- and big-endian bin, odc and newc variants), <em class="dfn">Linux ext2/ext3/ext4</em>, <em class="dfn">DOS FAT12/FAT16/FAT32</em>, <em class="dfn">exFAT</em>, <em class="dfn">F2FS</em>, <em class="dfn">HFS</em>, <em class="dfn">HFS+</em>, <em class="dfn">ISO9660</em> (including Joliet, Rock-ridge and multi-chunk files), <em class="dfn">JFS</em>, <em class="dfn">Minix fs</em> (versions 1, 2 and 3), <em class="dfn">nilfs2</em>, <em class="dfn">NTFS</em> (including compression), <em class="dfn">ReiserFS</em>, <em class="dfn">ROMFS</em>, <em class="dfn">Amiga Smart FileSystem (SFS)</em>, <em class="dfn">Squash4</em>, <em class="dfn">tar</em>, <em class="dfn">UDF</em>, <em class="dfn">BSD UFS/UFS2</em>, <em class="dfn">XFS</em>, and <em class="dfn">ZFS</em> (including lzjb, gzip, zle, mirror, stripe, raidz1/2/3 and encryption in AES-CCM and AES-GCM). See <a class="xref" href="#Filesystem">Filesystem syntax and semantics</a>, for more information. </p> </dd> <dt>Support automatic decompression</dt> <dd><p>Can decompress files which were compressed by <code class="command">gzip</code> or <code class="command">xz</code><a class="footnote" id="DOCF3" href="#FOOT3"><sup>3</sup></a>. This function is both automatic and transparent to the user (i.e. all functions operate upon the uncompressed contents of the specified files). This greatly reduces a file size and loading time, a particularly great benefit for floppies.<a class="footnote" id="DOCF4" href="#FOOT4"><sup>4</sup></a> </p> <p>It is conceivable that some kernel modules should be loaded in a compressed state, so a different module-loading command can be specified to avoid uncompressing the modules. </p> </dd> <dt>Access data on any installed device</dt> <dd><p>Support reading data from any or all floppies or hard disk(s) recognized by the BIOS, independent of the setting of the root device. </p> </dd> <dt>Be independent of drive geometry translations</dt> <dd><p>Unlike many other boot loaders, GRUB makes the particular drive translation irrelevant. A drive installed and running with one translation may be converted to another translation without any adverse effects or changes in GRUB’s configuration. </p> </dd> <dt>Detect all installed <small class="sc">RAM</small></dt> <dd><p>GRUB can generally find all the installed <small class="sc">RAM</small> on a PC-compatible machine. It uses an advanced BIOS query technique for finding all memory regions. As described on the Multiboot Specification (see <a data-manual="multiboot" href="https://www.gnu.org/software/grub/manual//multiboot/multiboot.html#Top">Motivation</a> in <cite class="cite">The Multiboot Specification</cite>), not all kernels make use of this information, but GRUB provides it for those who do. </p> </dd> <dt>Support Logical Block Address mode</dt> <dd><p>In traditional disk calls (called <em class="dfn">CHS mode</em>), there is a geometry translation problem, that is, the BIOS cannot access over 1024 cylinders, so the accessible space is limited to at least 508 MB and to at most 8GB. GRUB can’t universally solve this problem, as there is no standard interface used in all machines. However, several newer machines have the new interface, Logical Block Address (<em class="dfn">LBA</em>) mode. GRUB automatically detects if LBA mode is available and uses it if available. In LBA mode, GRUB can access the entire disk. </p> </dd> <dt>Support network booting</dt> <dd><p>GRUB is basically a disk-based boot loader but also has network support. You can load OS images from a network by using the <em class="dfn">TFTP</em> protocol. </p> </dd> <dt>Support remote terminals</dt> <dd><p>To support computers with no console, GRUB provides remote terminal support, so that you can control GRUB from a remote host. Only serial terminal support is implemented at the moment. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Role-of-a-boot-loader"> <div class="nav-panel"> <p> Previous: <a href="#Features" accesskey="p" rel="prev">GRUB features</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction to GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="The-role-of-a-boot-loader"><span>1.5 The role of a boot loader<a class="copiable-link" href="#The-role-of-a-boot-loader"> ¶</a></span></h3> <p>The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: </p> <blockquote class="quotation"> <p>Some people like to acknowledge both the operating system and kernel when they talk about their computers, so they might say they use “GNU/Linux” or “GNU/Hurd”. Other people seem to think that the kernel is the most important part of the system, so they like to call their GNU operating systems “Linux systems.” </p> <p>I, personally, believe that this is a grave injustice, because the <em class="emph">boot loader</em> is the most important software of all. I used to refer to the above systems as either “LILO”<a class="footnote" id="DOCF5" href="#FOOT5"><sup>5</sup></a> or “GRUB” systems. </p> <p>Unfortunately, nobody ever understood what I was talking about; now I just use the word “GNU” as a pseudonym for GRUB. </p> <p>So, if you ever hear people talking about their alleged “GNU” systems, remember that they are actually paying homage to the best boot loader around… GRUB! </p></blockquote> <p>We, the GRUB maintainers, do not (usually) encourage Gordon’s level of fanaticism, but it helps to remember that boot loaders deserve recognition. We hope that you enjoy using GNU GRUB as much as we did writing it. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Naming-convention"> <div class="nav-panel"> <p> Next: <a href="#OS_002dspecific-notes-about-grub-tools" accesskey="n" rel="next">OS-specific notes about grub tools</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction to GRUB</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Naming-convention-1"><span>2 Naming convention<a class="copiable-link" href="#Naming-convention-1"> ¶</a></span></h2> <p>The device syntax used in GRUB is a wee bit different from what you may have seen before in your operating system(s), and you need to know it so that you can specify a drive/partition. </p> <p>Look at the following examples and explanations: </p> <div class="example"> <pre class="example-preformatted">(fd0) </pre></div> <p>First of all, GRUB requires that the device name be enclosed with ‘<samp class="samp">(</samp>’ and ‘<samp class="samp">)</samp>’. The ‘<samp class="samp">fd</samp>’ part means that it is a floppy disk. The number ‘<samp class="samp">0</samp>’ is the drive number, which is counted from <em class="emph">zero</em>. This expression means that GRUB will use the whole floppy disk. </p> <div class="example"> <pre class="example-preformatted">(hd0,msdos2) </pre></div> <p>Here, ‘<samp class="samp">hd</samp>’ means it is a hard disk drive. The first integer ‘<samp class="samp">0</samp>’ indicates the drive number, that is, the first hard disk, the string ‘<samp class="samp">msdos</samp>’ indicates the partition scheme, while the second integer, ‘<samp class="samp">2</samp>’, indicates the partition number (or the <small class="sc">PC</small> slice number in the BSD terminology). The partition numbers are counted from <em class="emph">one</em>, not from zero (as was the case in previous versions of GRUB). This expression means the second partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk. </p> <div class="example"> <pre class="example-preformatted">(hd0,msdos5) </pre></div> <p>This specifies the first <em class="dfn">extended partition</em> of the first hard disk drive. Note that the partition numbers for extended partitions are counted from ‘<samp class="samp">5</samp>’, regardless of the actual number of primary partitions on your hard disk. </p> <div class="example"> <pre class="example-preformatted">(hd1,msdos1,bsd1) </pre></div> <p>This means the BSD ‘<samp class="samp">a</samp>’ partition on first <small class="sc">PC</small> slice number of the second hard disk. </p> <p>Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like ‘<samp class="samp">set root=(fd0)</samp>’ or ‘<samp class="samp">parttool (hd0,msdos3) hidden-</samp>’. To help you find out which number specifies a partition you want, the GRUB command-line (see <a class="pxref" href="#Command_002dline-interface">The flexible command-line interface</a>) options have argument completion. This means that, for example, you only need to type </p> <div class="example"> <pre class="example-preformatted">set root=( </pre></div> <p>followed by a <kbd class="key">TAB</kbd>, and GRUB will display the list of drives, partitions, or file names. So it should be quite easy to determine the name of your target partition, even with minimal knowledge of the syntax. </p> <p>Note that GRUB does <em class="emph">not</em> distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS. </p> <p>Now the question is, how to specify a file? Again, consider an example: </p> <div class="example"> <pre class="example-preformatted">(hd0,msdos1)/vmlinuz </pre></div> <p>This specifies the file named ‘<samp class="samp">vmlinuz</samp>’, found on the first partition of the first hard disk drive. Note that the argument completion works with file names, too. </p> <p>That was easy, admit it. Now read the next chapter, to find out how to actually install GRUB on your drive. </p> <hr> </div> <div class="chapter-level-extent" id="OS_002dspecific-notes-about-grub-tools"> <div class="nav-panel"> <p> Next: <a href="#Installation" accesskey="n" rel="next">Installation</a>, Previous: <a href="#Naming-convention" accesskey="p" rel="prev">Naming convention</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="OS_002dspecific-notes-about-grub-tools-1"><span>3 OS-specific notes about grub tools<a class="copiable-link" href="#OS_002dspecific-notes-about-grub-tools-1"> ¶</a></span></h2> <p>On OS which have device nodes similar to Unix-like OS GRUB tools use the OS name. E.g. for GNU/Linux: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install /dev/sda</kbd> </pre></div> <p>On AROS we use another syntax. For volumes: </p> <div class="example"> <pre class="example-preformatted">//:<volume name> </pre></div> <p>E.g. </p> <div class="example"> <pre class="example-preformatted">//:DH0 </pre></div> <p>For disks we use syntax: </p><div class="example"> <pre class="example-preformatted">//:<driver name>/unit/flags </pre></div> <p>E.g. </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install //:ata.device/0/0</kbd> </pre></div> <p>On Windows we use UNC path. For volumes it’s typically </p> <div class="example"> <pre class="example-preformatted">\\?\Volume{<GUID>} \\?\<drive letter>: </pre></div> <p>E.g. </p> <div class="example"> <pre class="example-preformatted">\\?\Volume{17f34d50-cf64-4b02-800e-51d79c3aa2ff} \\?\C: </pre></div> <p>For disks it’s </p> <div class="example"> <pre class="example-preformatted">\\?\PhysicalDrive<number> </pre></div> <p>E.g. </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install \\?\PhysicalDrive0</kbd> </pre></div> <p>Beware that you may need to further escape the backslashes depending on your shell. </p> <p>When compiled with cygwin support then cygwin drive names are automatically when needed. E.g. </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install /dev/sda</kbd> </pre></div> <hr> </div> <div class="chapter-level-extent" id="Installation"> <div class="nav-panel"> <p> Next: <a href="#Booting" accesskey="n" rel="next">Booting</a>, Previous: <a href="#OS_002dspecific-notes-about-grub-tools" accesskey="p" rel="prev">OS-specific notes about grub tools</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Installation-1"><span>4 Installation<a class="copiable-link" href="#Installation-1"> ¶</a></span></h2> <p>In order to install GRUB as your boot loader, you need to first install the GRUB system and utilities under your UNIX-like operating system (see <a class="pxref" href="#Obtaining-and-Building-GRUB">How to obtain and build GRUB</a>). You can do this either from the source tarball, or as a package for your OS. </p> <p>After you have done that, you need to install the boot loader on a drive (floppy or hard disk) by using the utility <code class="command">grub2-install</code> (see <a class="pxref" href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>) on a UNIX-like OS. </p> <p>GRUB comes with boot images, which are normally put in the directory <samp class="file">/usr/lib/grub/<cpu>-<platform></samp> (for BIOS-based machines <samp class="file">/usr/lib/grub/i386-pc</samp>). Hereafter, the directory where GRUB images are initially placed (normally <samp class="file">/usr/lib/grub/<cpu>-<platform></samp>) will be called the <em class="dfn">image directory</em>, and the directory where the boot loader needs to find them (usually <samp class="file">/boot</samp>) will be called the <em class="dfn">boot directory</em>. </p> <ul class="mini-toc"> <li><a href="#Installing-GRUB-using-grub2_002dinstall" accesskey="1">Installing GRUB using grub2-install</a></li> <li><a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="2">Making a GRUB bootable CD-ROM</a></li> <li><a href="#Device-map" accesskey="3">The map between BIOS drives and OS devices</a></li> <li><a href="#BIOS-installation" accesskey="4">BIOS installation</a></li> </ul> <hr> <div class="section-level-extent" id="Installing-GRUB-using-grub2_002dinstall"> <div class="nav-panel"> <p> Next: <a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="n" rel="next">Making a GRUB bootable CD-ROM</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Installing-GRUB-using-grub2_002dinstall-1"><span>4.1 Installing GRUB using grub2-install<a class="copiable-link" href="#Installing-GRUB-using-grub2_002dinstall-1"> ¶</a></span></h3> <p>For information on where GRUB should be installed on PC BIOS platforms, see <a class="pxref" href="#BIOS-installation">BIOS installation</a>. </p> <p>In order to install GRUB under a UNIX-like OS (such as <small class="sc">GNU</small>), invoke the program <code class="command">grub2-install</code> (see <a class="pxref" href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>) as the superuser (<em class="dfn">root</em>). </p> <p>The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like ‘<samp class="samp">/dev/hda</samp>’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install /dev/sda</kbd> </pre></div> <p>Likewise, under GNU/Hurd, this has the same effect: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install /dev/hd0</kbd> </pre></div> <p>But all the above examples assume that GRUB should put images under the <samp class="file">/boot</samp> directory. If you want GRUB to put images under a directory other than <samp class="file">/boot</samp>, you need to specify the option <samp class="option">--boot-directory</samp>. The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example: </p> <div class="example"> <div class="group"><pre class="example-preformatted"># <kbd class="kbd">mke2fs /dev/fd0</kbd> # <kbd class="kbd">mount -t ext2 /dev/fd0 /mnt</kbd> # <kbd class="kbd">mkdir /mnt/boot</kbd> # <kbd class="kbd">grub2-install --boot-directory=/mnt/boot /dev/fd0</kbd> # <kbd class="kbd">umount /mnt</kbd> </pre></div></div> <p>Some BIOSes have a bug of exposing the first partition of a USB drive as a floppy instead of exposing the USB drive as a hard disk (they call it “USB-FDD” boot). In such cases, you need to install like this: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">losetup /dev/loop0 /dev/sdb1</kbd> # <kbd class="kbd">mount /dev/loop0 /mnt/usb</kbd> # <kbd class="kbd">grub2-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0</kbd> </pre></div> <p>This install doesn’t conflict with standard install as long as they are in separate directories. </p> <p>Note that <code class="command">grub2-install</code> is actually just a shell script and the real task is done by other tools such as <code class="command">grub2-mkimage</code>. Therefore, you may run those commands directly to install GRUB, without using <code class="command">grub2-install</code>. Don’t do that, however, unless you are very familiar with the internals of GRUB. Installing a boot loader on a running OS may be extremely dangerous. </p> <p>On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at <samp class="file">/boot/efi</samp> then you don’t need any special arguments: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install</kbd> </pre></div> <p>Otherwise you need to specify where your EFI System partition is mounted: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install --efi-directory=/mnt/efi</kbd> </pre></div> <p>For removable installs you have to use <samp class="option">--removable</samp> and specify both <samp class="option">--boot-directory</samp> and <samp class="option">--efi-directory</samp>: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">grub2-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable</kbd> </pre></div> <hr> </div> <div class="section-level-extent" id="Making-a-GRUB-bootable-CD_002dROM"> <div class="nav-panel"> <p> Next: <a href="#Device-map" accesskey="n" rel="next">The map between BIOS drives and OS devices</a>, Previous: <a href="#Installing-GRUB-using-grub2_002dinstall" accesskey="p" rel="prev">Installing GRUB using grub2-install</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Making-a-GRUB-bootable-CD_002dROM-1"><span>4.2 Making a GRUB bootable CD-ROM<a class="copiable-link" href="#Making-a-GRUB-bootable-CD_002dROM-1"> ¶</a></span></h3> <p>GRUB supports the <em class="dfn">no emulation mode</em> in the El Torito specification<a class="footnote" id="DOCF6" href="#FOOT6"><sup>6</sup></a>. This means that you can use the whole CD-ROM from GRUB and you don’t have to make a floppy or hard disk image file, which can cause compatibility problems. </p> <p>For booting from a CD-ROM, GRUB uses a special image called <samp class="file">cdboot.img</samp>, which is concatenated with <samp class="file">core.img</samp>. The <samp class="file">core.img</samp> used for this should be built with at least the ‘<samp class="samp">iso9660</samp>’ and ‘<samp class="samp">biosdisk</samp>’ modules. Your bootable CD-ROM will usually also need to include a configuration file <samp class="file">grub.cfg</samp> and some other GRUB modules. </p> <p>To make a simple generic GRUB rescue CD, you can use the <code class="command">grub2-mkrescue</code> program (see <a class="pxref" href="#Invoking-grub2_002dmkrescue">Invoking grub2-mkrescue</a>): </p> <div class="example"> <pre class="example-preformatted">$ <kbd class="kbd">grub2-mkrescue -o grub.iso</kbd> </pre></div> <p>You will often need to include other files in your image. To do this, first make a top directory for the bootable image, say, ‘<samp class="samp">iso</samp>’: </p> <div class="example"> <pre class="example-preformatted">$ <kbd class="kbd">mkdir iso</kbd> </pre></div> <p>Make a directory for GRUB: </p> <div class="example"> <pre class="example-preformatted">$ <kbd class="kbd">mkdir -p iso/boot/grub</kbd> </pre></div> <p>If desired, make the config file <samp class="file">grub.cfg</samp> under <samp class="file">iso/boot/grub</samp> (see <a class="pxref" href="#Configuration">Writing your own configuration file</a>), and copy any files and directories for the disc to the directory <samp class="file">iso/</samp>. </p> <p>Finally, make the image: </p> <div class="example"> <pre class="example-preformatted">$ <kbd class="kbd">grub2-mkrescue -o grub.iso iso</kbd> </pre></div> <p>This produces a file named <samp class="file">grub.iso</samp>, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. </p> <p>The root device will be set up appropriately on entering your <samp class="file">grub.cfg</samp> configuration file, so you can refer to file names on the CD without needing to use an explicit device name. This makes it easier to produce rescue images that will work on both optical drives and USB mass storage devices. </p> <hr> </div> <div class="section-level-extent" id="Device-map"> <div class="nav-panel"> <p> Next: <a href="#BIOS-installation" accesskey="n" rel="next">BIOS installation</a>, Previous: <a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="p" rel="prev">Making a GRUB bootable CD-ROM</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="The-map-between-BIOS-drives-and-OS-devices"><span>4.3 The map between BIOS drives and OS devices<a class="copiable-link" href="#The-map-between-BIOS-drives-and-OS-devices"> ¶</a></span></h3> <p>If the device map file exists, the GRUB utilities (<code class="command">grub2-probe</code>, etc.) read it to map BIOS drives to OS devices. This file consists of lines like this: </p> <div class="example"> <pre class="example-preformatted">(<var class="var">device</var>) <var class="var">file</var> </pre></div> <p><var class="var">device</var> is a drive specified in the GRUB syntax (see <a class="pxref" href="#Device-syntax">How to specify devices</a>), and <var class="var">file</var> is an OS file, which is normally a device file. </p> <p>Historically, the device map file was used because GRUB device names had to be used in the configuration file, and they were derived from BIOS drive numbers. The map between BIOS drives and OS devices cannot always be guessed correctly: for example, GRUB will get the order wrong if you exchange the boot sequence between IDE and SCSI in your BIOS. </p> <p>Unfortunately, even OS device names are not always stable. Modern versions of the Linux kernel may probe drives in a different order from boot to boot, and the prefix (<samp class="file">/dev/hd*</samp> versus <samp class="file">/dev/sd*</samp>) may change depending on the driver subsystem in use. As a result, the device map file required frequent editing on some systems. </p> <p>GRUB avoids this problem nowadays by using UUIDs or file system labels when generating <samp class="file">grub.cfg</samp>, and we advise that you do the same for any custom menu entries you write. If the device map file does not exist, then the GRUB utilities will assume a temporary device map on the fly. This is often good enough, particularly in the common case of single-disk systems. </p> <p>However, the device map file is not entirely obsolete yet, and it is used for overriding when current environment is different from the one on boot. Most common case is if you use a partition or logical volume as a disk for virtual machine. You can put any comments in the file if needed, as the GRUB utilities assume that a line is just a comment if the first character is ‘<samp class="samp">#</samp>’. </p> <hr> </div> <div class="section-level-extent" id="BIOS-installation"> <div class="nav-panel"> <p> Previous: <a href="#Device-map" accesskey="p" rel="prev">The map between BIOS drives and OS devices</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="BIOS-installation-1"><span>4.4 BIOS installation<a class="copiable-link" href="#BIOS-installation-1"> ¶</a></span></h3> <h3 class="heading" id="MBR"><span>MBR<a class="copiable-link" href="#MBR"> ¶</a></span></h3> <p>The partition table format traditionally used on PC BIOS platforms is called the Master Boot Record (MBR) format; this is the format that allows up to four primary partitions and additional logical partitions. With this partition table format, there are two ways to install GRUB: it can be embedded in the area between the MBR and the first partition (called by various names, such as the "boot track", "MBR gap", or "embedding area", and which is usually at least 1000 KiB), or the core image can be installed in a file system and a list of the blocks that make it up can be stored in the first sector of that partition. </p> <p>Modern tools usually leave MBR gap of at least 1023 KiB. This amount is sufficient to cover most configurations. Hence this value is recommended by the GRUB team. </p> <p>Historically many tools left only 31 KiB of space. This is not enough to parse reliably difficult structures like Btrfs, ZFS, RAID or LVM, or to use difficult disk access methods like ahci. Hence GRUB will warn if attempted to install into small MBR gap except in a small number of configurations that were grandfathered. The grandfathered config must: </p> <ul class="itemize mark-bullet"> <li>use biosdisk as disk access module for <samp class="file">/boot</samp> </li><li>not use any additional partition maps to access <samp class="file">/boot</samp> </li><li><samp class="file">/boot</samp> must be on one of following filesystems: AFFS, AFS, BFS, cpio, newc, odc, ext2/3/4, FAT, exFAT, F2FS, HFS, uncompressed HFS+, ISO9660, JFS, Minix, Minix2, Minix3, NILFS2, NTFS, ReiserFS, ROMFS, SFS, tar, UDF, UFS1, UFS2, XFS </li></ul> <p>MBR gap has few technical problems. There is no way to reserve space in the embedding area with complete safety, and some proprietary software is known to use it to make it difficult for users to work around licensing restrictions. GRUB works around it by detecting sectors by other software and avoiding them and protecting its own sectors using Reed-Solomon encoding. </p> <p>GRUB team recommends having MBR gap of at least 1000 KiB. </p> <p>Should it not be possible, GRUB has support for a fallback solution which is heavily recommended against. Installing to a filesystem means that GRUB is vulnerable to its blocks being moved around by filesystem features such as tail packing, or even by aggressive fsck implementations, so this approach is quite fragile; and this approach can only be used if the <samp class="file">/boot</samp> filesystem is on the same disk that the BIOS boots from, so that GRUB does not have to rely on guessing BIOS drive numbers. </p> <p>The GRUB development team generally recommends embedding GRUB before the first partition, unless you have special requirements. You must ensure that the first partition starts at least 1000 KiB (2000 sectors) from the start of the disk; on modern disks, it is often a performance advantage to align partitions on larger boundaries anyway, so the first partition might start 1 MiB from the start of the disk. </p> <h3 class="heading" id="GPT"><span>GPT<a class="copiable-link" href="#GPT"> ¶</a></span></h3> <p>Some newer systems use the GUID Partition Table (GPT) format. This was specified as part of the Extensible Firmware Interface (EFI), but it can also be used on BIOS platforms if system software supports it; for example, GRUB and GNU/Linux can be used in this configuration. With this format, it is possible to reserve a whole partition for GRUB, called the BIOS Boot Partition. GRUB can then be embedded into that partition without the risk of being overwritten by other software and without being contained in a filesystem which might move its blocks around. </p> <p>When creating a BIOS Boot Partition on a GPT system, you should make sure that it is at least 31 KiB in size. (GPT-formatted disks are not usually particularly small, so we recommend that you make it larger than the bare minimum, such as 1 MiB, to allow plenty of room for growth.) You must also make sure that it has the proper partition type. Using GNU Parted, you can set this using a command such as the following: </p> <div class="example"> <pre class="example-preformatted"># <kbd class="kbd">parted /dev/<var class="var">disk</var> set <var class="var">partition-number</var> bios_grub on</kbd> </pre></div> <p>If you are using gdisk, set the partition type to ‘<samp class="samp">0xEF02</samp>’. With partitioning programs that require setting the GUID directly, it should be ‘<samp class="samp">21686148-6449-6e6f-744e656564454649</samp>’. </p> <p><strong class="strong">Caution:</strong> Be very careful which partition you select! When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Booting"> <div class="nav-panel"> <p> Next: <a href="#Configuration" accesskey="n" rel="next">Writing your own configuration file</a>, Previous: <a href="#Installation" accesskey="p" rel="prev">Installation</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Booting-1"><span>5 Booting<a class="copiable-link" href="#Booting-1"> ¶</a></span></h2> <p>GRUB can load Multiboot-compliant kernels in a consistent way, but for some free operating systems you need to use some OS-specific magic. </p> <ul class="mini-toc"> <li><a href="#General-boot-methods" accesskey="1">How to boot operating systems</a></li> <li><a href="#Loopback-booting" accesskey="2">Loopback booting</a></li> <li><a href="#LVM-cache-booting" accesskey="3">Booting from LVM cache logical volume</a></li> <li><a href="#OS_002dspecific-notes" accesskey="4">Some caveats on OS-specific issues</a></li> </ul> <hr> <div class="section-level-extent" id="General-boot-methods"> <div class="nav-panel"> <p> Next: <a href="#Loopback-booting" accesskey="n" rel="next">Loopback booting</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="How-to-boot-operating-systems"><span>5.1 How to boot operating systems<a class="copiable-link" href="#How-to-boot-operating-systems"> ¶</a></span></h3> <p>GRUB has three distinct boot methods: loading an operating system directly, using kexec from userspace, and chainloading another bootloader. Generally speaking, the first two are more desirable because you don’t need to install or maintain other boot loaders and GRUB is flexible enough to load an operating system from an arbitrary disk/partition. However, chainloading is sometimes required, as GRUB doesn’t support all existing operating systems natively. </p> <ul class="mini-toc"> <li><a href="#Loading-an-operating-system-directly" accesskey="1">How to boot an OS directly with GRUB</a></li> <li><a href="#Kexec" accesskey="2">Kexec with grub2-emu</a></li> <li><a href="#Chain_002dloading" accesskey="3">Chain-loading an OS</a></li> </ul> <hr> <div class="subsection-level-extent" id="Loading-an-operating-system-directly"> <div class="nav-panel"> <p> Next: <a href="#Kexec" accesskey="n" rel="next">Kexec with grub2-emu</a>, Up: <a href="#General-boot-methods" accesskey="u" rel="up">How to boot operating systems</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="How-to-boot-an-OS-directly-with-GRUB"><span>5.1.1 How to boot an OS directly with GRUB<a class="copiable-link" href="#How-to-boot-an-OS-directly-with-GRUB"> ¶</a></span></h4> <p>Multiboot (see <a data-manual="multiboot" href="https://www.gnu.org/software/grub/manual//multiboot/multiboot.html#Top">Motivation</a> in <cite class="cite">The Multiboot Specification</cite>) is the native format supported by GRUB. For the sake of convenience, there is also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (see <a class="pxref" href="#Chain_002dloading">Chain-loading an OS</a>). </p> <p>FIXME: this section is incomplete. </p> <ol class="enumerate"> <li> Run the command <code class="command">boot</code> (see <a class="pxref" href="#boot">boot</a>). </li></ol> <p>However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See <a class="xref" href="#DOS_002fWindows">DOS/Windows</a>, for more information. </p> <hr> </div> <div class="subsection-level-extent" id="Kexec"> <div class="nav-panel"> <p> Next: <a href="#Chain_002dloading" accesskey="n" rel="next">Chain-loading an OS</a>, Previous: <a href="#Loading-an-operating-system-directly" accesskey="p" rel="prev">How to boot an OS directly with GRUB</a>, Up: <a href="#General-boot-methods" accesskey="u" rel="up">How to boot operating systems</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="Kexec-with-grub2_002demu"><span>5.1.2 Kexec with grub2-emu<a class="copiable-link" href="#Kexec-with-grub2_002demu"> ¶</a></span></h4> <p>GRUB can be run in userspace by invoking the grub2-emu tool. It will read all configuration scripts as if booting directly (see <a class="ref" href="#Loading-an-operating-system-directly">How to boot an OS directly with GRUB</a>). With the <code class="code">--kexec</code> flag, and kexec(8) support from the operating system, the <code class="command">linux</code> command will directly boot the target image. For systems that lack working systemctl(1) support for kexec, passing the <code class="code">--kexec</code> flag twice will fallback to invoking kexec(8) directly; note however that this fallback may be unsafe outside read-only environments, as it does not invoke shutdown machinery. </p> <hr> </div> <div class="subsection-level-extent" id="Chain_002dloading"> <div class="nav-panel"> <p> Previous: <a href="#Kexec" accesskey="p" rel="prev">Kexec with grub2-emu</a>, Up: <a href="#General-boot-methods" accesskey="u" rel="up">How to boot operating systems</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="Chain_002dloading-an-OS"><span>5.1.3 Chain-loading an OS<a class="copiable-link" href="#Chain_002dloading-an-OS"> ¶</a></span></h4> <p>Operating systems that do not support Multiboot and do not have specific support in GRUB (specific support is available for Linux, FreeBSD, NetBSD and OpenBSD) must be chain-loaded, which involves loading another boot loader and jumping to it in real mode or via the firmware. </p> <p>The <code class="command">chainloader</code> command (see <a class="pxref" href="#chainloader">chainloader</a>) is used to set this up. It is normally also necessary to load some GRUB modules and set the appropriate root device. Putting this together, we get something like this, for a Windows system on the first partition of the first hard disk: </p> <pre class="verbatim">menuentry "Windows" { insmod chain insmod ntfs set root=(hd0,1) chainloader +1 } </pre> <p>On systems with multiple hard disks, an additional workaround may be required. See <a class="xref" href="#DOS_002fWindows">DOS/Windows</a>. </p> <p>Chain-loading is only supported on PC BIOS and EFI platforms. </p> <hr> </div> </div> <div class="section-level-extent" id="Loopback-booting"> <div class="nav-panel"> <p> Next: <a href="#LVM-cache-booting" accesskey="n" rel="next">Booting from LVM cache logical volume</a>, Previous: <a href="#General-boot-methods" accesskey="p" rel="prev">How to boot operating systems</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Loopback-booting-1"><span>5.2 Loopback booting<a class="copiable-link" href="#Loopback-booting-1"> ¶</a></span></h3> <p>GRUB is able to read from an image (be it one of CD or HDD) stored on any of its accessible storages (refer to see <a class="pxref" href="#loopback">loopback</a> command). However the OS itself should be able to find its root. This usually involves running a userspace program running before the real root is discovered. This is achieved by GRUB loading a specially made small image and passing it as ramdisk to the kernel. This is achieved by commands <code class="command">kfreebsd_module</code>, <code class="command">knetbsd_module_elf</code>, <code class="command">kopenbsd_ramdisk</code>, <code class="command">initrd</code> (see <a class="pxref" href="#initrd">initrd</a>), <code class="command">initrd16</code> (see <a class="pxref" href="#initrd16">initrd16</a>), <code class="command">multiboot_module</code>, <code class="command">multiboot2_module</code> or <code class="command">xnu_ramdisk</code> depending on the loader. Note that for knetbsd the image must be put inside miniroot.kmod and the whole miniroot.kmod has to be loaded. In kopenbsd payload this is disabled by default. Additionally, behaviour of initial ramdisk depends on command line options. Several distributors provide the image for this purpose or it’s integrated in their standard ramdisk and activated by special option. Consult your kernel and distribution manual for more details. Other loaders like <code class="command">appleloader</code>, <code class="command">chainloader</code> (BIOS, EFI, coreboot), <code class="command">freedos</code>, <code class="command">ntldr</code>, <code class="command">plan9</code> and <code class="command">truecrypt</code> provide no possibility of loading initial ramdisk and as far as author is aware the payloads in question don’t support either initial ramdisk or discovering loopback boot in other way and as such not bootable this way. Please consider alternative boot methods like copying all files from the image to actual partition. Consult your OS documentation for more details. </p> <hr> </div> <div class="section-level-extent" id="LVM-cache-booting"> <div class="nav-panel"> <p> Next: <a href="#OS_002dspecific-notes" accesskey="n" rel="next">Some caveats on OS-specific issues</a>, Previous: <a href="#Loopback-booting" accesskey="p" rel="prev">Loopback booting</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Booting-from-LVM-cache-logical-volume"><span>5.3 Booting from LVM cache logical volume<a class="copiable-link" href="#Booting-from-LVM-cache-logical-volume"> ¶</a></span></h3> <p>The LVM cache logical volume is the logical volume consisting of the original and the cache pool logical volume. The original is usually on a larger and slower storage device while the cache pool is on a smaller and faster one. The performance of the original volume can be improved by storing the frequently used data on the cache pool to utilize the greater performance of faster device. </p> <p>GRUB boots from LVM cache logical volume merely by reading it’s original logical volume so that dirty data in cache pool volume is disregarded. This is not a problem for "writethrough" cache mode as it ensures that any data written will be stored both on the cache and the origin LV. For the other cache mode "writeback", which delays writing from the cache pool back to the origin LV to boost performance, GRUB may fail to boot in the wake of accidental power outage due to it’s inability to assemble the cache device for reading the required dirty data left behind. The situation will be improved after adding full support to the LVM cache logical volume in the future. </p> <hr> </div> <div class="section-level-extent" id="OS_002dspecific-notes"> <div class="nav-panel"> <p> Previous: <a href="#LVM-cache-booting" accesskey="p" rel="prev">Booting from LVM cache logical volume</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Some-caveats-on-OS_002dspecific-issues"><span>5.4 Some caveats on OS-specific issues<a class="copiable-link" href="#Some-caveats-on-OS_002dspecific-issues"> ¶</a></span></h3> <p>Here, we describe some caveats on several operating systems. </p> <ul class="mini-toc"> <li><a href="#GNU_002fHurd" accesskey="1">GNU/Hurd</a></li> <li><a href="#GNU_002fLinux" accesskey="2">GNU/Linux</a></li> <li><a href="#NetBSD" accesskey="3">NetBSD</a></li> <li><a href="#DOS_002fWindows" accesskey="4">DOS/Windows</a></li> </ul> <hr> <div class="subsection-level-extent" id="GNU_002fHurd"> <div class="nav-panel"> <p> Next: <a href="#GNU_002fLinux" accesskey="n" rel="next">GNU/Linux</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">Some caveats on OS-specific issues</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="GNU_002fHurd-1"><span>5.4.1 GNU/Hurd<a class="copiable-link" href="#GNU_002fHurd-1"> ¶</a></span></h4> <p>Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is nothing special about it. But do not forget that you have to specify a root partition to the kernel. </p> <ol class="enumerate"> <li> Set GRUB’s root device to the same drive as GNU/Hurd’s. The command <code class="code">search --set=root --file /boot/gnumach.gz</code> or similar may help you (see <a class="pxref" href="#search">search</a>). </li><li> Load the kernel and the modules, like this: <div class="example"> <div class="group"><pre class="example-preformatted">grub> <kbd class="kbd">multiboot /boot/gnumach.gz root=device:hd0s1</kbd> grub> <kbd class="kbd">module /hurd/ext2fs.static ext2fs --readonly \ --multiboot-command-line='${kernel-command-line}' \ --host-priv-port='${host-port}' \ --device-master-port='${device-port}' \ --exec-server-task='${exec-task}' -T typed '${root}' \ '$(task-create)' '$(task-resume)'</kbd> grub> <kbd class="kbd">module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'</kbd> </pre></div></div> </li><li> Finally, run the command <code class="command">boot</code> (see <a class="pxref" href="#boot">boot</a>). </li></ol> <hr> </div> <div class="subsection-level-extent" id="GNU_002fLinux"> <div class="nav-panel"> <p> Next: <a href="#NetBSD" accesskey="n" rel="next">NetBSD</a>, Previous: <a href="#GNU_002fHurd" accesskey="p" rel="prev">GNU/Hurd</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">Some caveats on OS-specific issues</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="GNU_002fLinux-1"><span>5.4.2 GNU/Linux<a class="copiable-link" href="#GNU_002fLinux-1"> ¶</a></span></h4> <p>It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS. </p> <ol class="enumerate"> <li> Set GRUB’s root device to the same drive as GNU/Linux’s. The command <code class="code">search --set=root --file /vmlinuz</code> or similar may help you (see <a class="pxref" href="#search">search</a>). </li><li> Load the kernel using the command <code class="command">linux</code> (see <a class="pxref" href="#linux">linux</a>): <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">linux /vmlinuz root=/dev/sda1</kbd> </pre></div> <p>If you need to specify some kernel parameters, just append them to the command. For example, to set <samp class="option">acpi</samp> to ‘<samp class="samp">off</samp>’, do this: </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">linux /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre></div> <p>See the documentation in the Linux source tree for complete information on the available options. </p> <p>With <code class="command">linux</code> GRUB uses 32-bit protocol. Some BIOS services like APM or EDD aren’t available with this protocol. In this case you need to use <code class="command">linux16</code> </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">linux16 /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre></div> </li><li> If you use an initrd, execute the command <code class="command">initrd</code> (see <a class="pxref" href="#initrd">initrd</a>) after <code class="command">linux</code>: <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">initrd /initrd</kbd> </pre></div> <p>If you used <code class="command">linux16</code> you need to use <code class="command">initrd16</code>: </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">initrd16 /initrd</kbd> </pre></div> </li><li> Finally, run the command <code class="command">boot</code> (see <a class="pxref" href="#boot">boot</a>). </li></ol> <hr> </div> <div class="subsection-level-extent" id="NetBSD"> <div class="nav-panel"> <p> Next: <a href="#DOS_002fWindows" accesskey="n" rel="next">DOS/Windows</a>, Previous: <a href="#GNU_002fLinux" accesskey="p" rel="prev">GNU/Linux</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">Some caveats on OS-specific issues</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="NetBSD-1"><span>5.4.3 NetBSD<a class="copiable-link" href="#NetBSD-1"> ¶</a></span></h4> <p>Booting a NetBSD kernel from GRUB is also relatively easy: first set GRUB’s root device, then load the kernel and the modules, and finally run <code class="command">boot</code>. </p> <ol class="enumerate"> <li> Set GRUB’s root device to the partition holding the NetBSD root file system. For a disk with a NetBSD disk label, this is usually the first partition (a:). In that case, and assuming that the partition is on the first hard disk, set GRUB’s root device as follows: <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">insmod part_bsd</kbd> grub> <kbd class="kbd">set root=(hd0,netbsd1)</kbd> </pre></div> <p>For a disk with a GUID Partition Table (GPT), and assuming that the NetBSD root partition is the third GPT partition, do this: </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">insmod part_gpt</kbd> grub> <kbd class="kbd">set root=(hd0,gpt3)</kbd> </pre></div> </li><li> Load the kernel using the command <code class="command">knetbsd</code>: <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">knetbsd /netbsd</kbd> </pre></div> <p>Various options may be given to <code class="command">knetbsd</code>. These options are, for the most part, the same as in the NetBSD boot loader. For instance, to boot the system in single-user mode and with verbose messages, do this: </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">knetbsd /netbsd -s -v</kbd> </pre></div> </li><li> If needed, load kernel modules with the command <code class="command">knetbsd_module_elf</code>. A typical example is the module for the root file system: <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod</kbd> </pre></div> </li><li> Finally, run the command <code class="command">boot</code> (see <a class="pxref" href="#boot">boot</a>). </li></ol> <hr> </div> <div class="subsection-level-extent" id="DOS_002fWindows"> <div class="nav-panel"> <p> Previous: <a href="#NetBSD" accesskey="p" rel="prev">NetBSD</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">Some caveats on OS-specific issues</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="DOS_002fWindows-1"><span>5.4.4 DOS/Windows<a class="copiable-link" href="#DOS_002fWindows-1"> ¶</a></span></h4> <p>GRUB cannot boot DOS or Windows directly, so you must chain-load them (see <a class="pxref" href="#Chain_002dloading">Chain-loading an OS</a>). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions. </p> <p>If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command <code class="command">drivemap</code> (see <a class="pxref" href="#drivemap">drivemap</a>), like this: </p> <div class="example"> <pre class="example-preformatted">drivemap -s (hd0) (hd1) </pre></div> <p>This performs a <em class="dfn">virtual</em> swap between your first and second hard drive. </p> <p><strong class="strong">Caution:</strong> This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won’t work. </p> <p>Another problem arises if you installed more than one set of DOS/Windows onto one disk, because they could be confused if there are more than one primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique. </p> <p>If GRUB <em class="dfn">hides</em> a DOS (or Windows) partition (see <a class="pxref" href="#parttool">parttool</a>), DOS (or Windows) will ignore the partition. If GRUB <em class="dfn">unhides</em> a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do the following: </p> <div class="example"> <div class="group"><pre class="example-preformatted">parttool (hd0,1) hidden- parttool (hd0,2) hidden+ set root=(hd0,1) chainloader +1 parttool <code class="verb">${root}</code> boot+ boot </pre></div></div> <hr> </div> </div> </div> <div class="chapter-level-extent" id="Configuration"> <div class="nav-panel"> <p> Next: <a href="#Theme-file-format" accesskey="n" rel="next">Theme file format</a>, Previous: <a href="#Booting" accesskey="p" rel="prev">Booting</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Writing-your-own-configuration-file"><span>6 Writing your own configuration file<a class="copiable-link" href="#Writing-your-own-configuration-file"> ¶</a></span></h2> <p>GRUB is configured using <samp class="file">grub.cfg</samp>, usually located under <samp class="file">/boot/grub</samp>. This file is quite flexible, but most users will not need to write the whole thing by hand. </p> <ul class="mini-toc"> <li><a href="#Simple-configuration" accesskey="1">Simple configuration handling</a></li> <li><a href="#Root-Identifcation-Heuristics" accesskey="2">Root Identifcation Heuristics</a></li> <li><a href="#Shell_002dlike-scripting" accesskey="3">Writing full configuration files directly</a></li> <li><a href="#Multi_002dboot-manual-config" accesskey="4">Multi-boot manual config</a></li> <li><a href="#Embedded-configuration" accesskey="5">Embedding a configuration file into GRUB</a></li> </ul> <hr> <div class="section-level-extent" id="Simple-configuration"> <div class="nav-panel"> <p> Next: <a href="#Root-Identifcation-Heuristics" accesskey="n" rel="next">Root Identifcation Heuristics</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Writing your own configuration file</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Simple-configuration-handling"><span>6.1 Simple configuration handling<a class="copiable-link" href="#Simple-configuration-handling"> ¶</a></span></h3> <p>The program <code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>) generates <samp class="file">grub.cfg</samp> files suitable for most cases. It is suitable for use when upgrading a distribution, and will discover available kernels and attempt to generate menu entries for them. </p> <p><code class="command">grub2-mkconfig</code> does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing <samp class="file">/etc/grub.d/40_custom</samp> or creating <samp class="file">/boot/grub2/custom.cfg</samp>, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in <samp class="file">/etc/grub.d/</samp>. This may be improved in the future. In the meantime, those who feel that it would be easier to write <samp class="file">grub.cfg</samp> directly are encouraged to do so (see <a class="pxref" href="#Booting">Booting</a>, and <a class="ref" href="#Shell_002dlike-scripting">Writing full configuration files directly</a>), and to disable any system provided by their distribution to automatically run <code class="command">grub2-mkconfig</code>. </p> <p>The file <samp class="file">/etc/default/grub</samp> controls the operation of <code class="command">grub2-mkconfig</code>. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘<samp class="samp">KEY=value</samp>’ lines, but if the value contains spaces or other special characters then it must be quoted. For example: </p> <div class="example"> <pre class="example-preformatted">GRUB_TERMINAL_INPUT="console serial" </pre></div> <p>Valid keys in <samp class="file">/etc/default/grub</samp> are as follows: </p> <dl class="table"> <dt>‘<samp class="samp">GRUB_DEFAULT</samp>’</dt> <dd><p>The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘<samp class="samp">saved</samp>’. Using the id may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it. </p> <p>For example, if you have: </p> <pre class="verbatim">menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux { ... } </pre> <p>then you can make this the default using: </p> <div class="example"> <pre class="example-preformatted">GRUB_DEFAULT=example-gnu-linux </pre></div> <p>Previously it was documented the way to use entry title. While this still works it’s not recommended since titles often contain unstable device names and may be translated </p> <p>If you set this to ‘<samp class="samp">saved</samp>’, then the default menu entry will be that saved by ‘<samp class="samp">GRUB_SAVEDEFAULT</samp>’ or <code class="command">grub2-set-default</code>. This relies on the environment block, which may not be available in all situations (see <a class="pxref" href="#Environment-block">The GRUB environment block</a>). </p> <p>The default is ‘<samp class="samp">0</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_SAVEDEFAULT</samp>’</dt> <dd><p>If this option is set to ‘<samp class="samp">true</samp>’, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ‘<samp class="samp">GRUB_DEFAULT=saved</samp>’; it is a separate option because ‘<samp class="samp">GRUB_DEFAULT=saved</samp>’ is useful without this option, in conjunction with <code class="command">grub2-set-default</code>. Unset by default. This option relies on the environment block, which may not be available in all situations (see <a class="pxref" href="#Environment-block">The GRUB environment block</a>). </p> </dd> <dt>‘<samp class="samp">GRUB_TIMEOUT</samp>’</dt> <dd><p>Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘<samp class="samp">5</samp>’. Set to ‘<samp class="samp">0</samp>’ to boot immediately without displaying the menu, or to ‘<samp class="samp">-1</samp>’ to wait indefinitely. </p> <p>If ‘<samp class="samp">GRUB_TIMEOUT_STYLE</samp>’ is set to ‘<samp class="samp">countdown</samp>’ or ‘<samp class="samp">hidden</samp>’, the timeout is instead counted before the menu is displayed. </p> </dd> <dt>‘<samp class="samp">GRUB_TIMEOUT_STYLE</samp>’</dt> <dd><p>If this option is unset or set to ‘<samp class="samp">menu</samp>’, then GRUB will display the menu and then wait for the timeout set by ‘<samp class="samp">GRUB_TIMEOUT</samp>’ to expire before booting the default entry. Pressing a key interrupts the timeout. </p> <p>If this option is set to ‘<samp class="samp">countdown</samp>’ or ‘<samp class="samp">hidden</samp>’, then, before displaying the menu, GRUB will wait for the timeout set by ‘<samp class="samp">GRUB_TIMEOUT</samp>’ to expire. If <kbd class="key">ESC</kbd> or <kbd class="key">F4</kbd> are pressed, or <kbd class="key">SHIFT</kbd> is held down during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the ‘<samp class="samp">countdown</samp>’ case, it will show a one-line indication of the remaining time. </p> </dd> <dt>‘<samp class="samp">GRUB_DEFAULT_BUTTON</samp>’</dt> <dt>‘<samp class="samp">GRUB_TIMEOUT_BUTTON</samp>’</dt> <dt>‘<samp class="samp">GRUB_TIMEOUT_STYLE_BUTTON</samp>’</dt> <dt>‘<samp class="samp">GRUB_BUTTON_CMOS_ADDRESS</samp>’</dt> <dd><p>Variants of the corresponding variables without the ‘<samp class="samp">_BUTTON</samp>’ suffix, used to support vendor-specific power buttons. See <a class="xref" href="#Vendor-power_002don-keys">Using GRUB with vendor power-on keys</a>. </p> </dd> <dt>‘<samp class="samp">GRUB_DISTRIBUTOR</samp>’</dt> <dd><p>Set by distributors of GRUB to their identifying name. This is used to generate more informative menu entry titles. </p> </dd> <dt>‘<samp class="samp">GRUB_TERMINAL_INPUT</samp>’</dt> <dd><p>Select the terminal input device. You may select multiple devices here, separated by spaces. </p> <p>Valid terminal input names depend on the platform, but may include ‘<samp class="samp">console</samp>’ (native platform console), ‘<samp class="samp">serial</samp>’ (serial terminal), ‘<samp class="samp">serial_<port></samp>’ (serial terminal with explicit port selection), ‘<samp class="samp">at_keyboard</samp>’ (PC AT keyboard), or ‘<samp class="samp">usb_keyboard</samp>’ (USB keyboard using the HID Boot Protocol, for cases where the firmware does not handle this). </p> <p>The default is to use the platform’s native terminal input. </p> </dd> <dt>‘<samp class="samp">GRUB_TERMINAL_OUTPUT</samp>’</dt> <dd><p>Select the terminal output device. You may select multiple devices here, separated by spaces. </p> <p>Valid terminal output names depend on the platform, but may include ‘<samp class="samp">console</samp>’ (native platform console), ‘<samp class="samp">serial</samp>’ (serial terminal), ‘<samp class="samp">serial_<port></samp>’ (serial terminal with explicit port selection), ‘<samp class="samp">gfxterm</samp>’ (graphics-mode output), ‘<samp class="samp">vga_text</samp>’ (VGA text output), ‘<samp class="samp">mda_text</samp>’ (MDA text output), ‘<samp class="samp">morse</samp>’ (Morse-coding using system beeper) or ‘<samp class="samp">spkmodem</samp>’ (simple data protocol using system speaker). </p> <p>‘<samp class="samp">spkmodem</samp>’ is useful when no serial port is available. Connect the output of sending system (where GRUB is running) to line-in of receiving system (usually developer machine). On receiving system compile ‘<samp class="samp">spkmodem-recv</samp>’ from ‘<samp class="samp">util/spkmodem-recv.c</samp>’ and run: </p> <div class="example"> <pre class="example-preformatted">parecord --channels=1 --rate=48000 --format=s16le | ./spkmodem-recv </pre></div> <p>The default is to use the platform’s native terminal output. </p> </dd> <dt>‘<samp class="samp">GRUB_TERMINAL</samp>’</dt> <dd><p>If this option is set, it overrides both ‘<samp class="samp">GRUB_TERMINAL_INPUT</samp>’ and ‘<samp class="samp">GRUB_TERMINAL_OUTPUT</samp>’ to the same value. </p> </dd> <dt>‘<samp class="samp">GRUB_SERIAL_COMMAND</samp>’</dt> <dd><p>A command to configure the serial port when using the serial console. See <a class="xref" href="#serial">serial</a>. Defaults to ‘<samp class="samp">serial</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’</dt> <dd><p>Command-line arguments to add to menu entries for the Linux kernel. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_LINUX_DEFAULT</samp>’</dt> <dd><p>Unless ‘<samp class="samp">GRUB_DISABLE_RECOVERY</samp>’ is set to ‘<samp class="samp">true</samp>’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_LINUX_RECOVERY</samp>’</dt> <dd><p>Unless ‘<samp class="samp">GRUB_DISABLE_RECOVERY</samp>’ is set to ‘<samp class="samp">true</samp>’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the recovery menu entry, before those listed in ‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’. The default is ‘<samp class="samp">single</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_NETBSD</samp>’</dt> <dt>‘<samp class="samp">GRUB_CMDLINE_NETBSD_DEFAULT</samp>’</dt> <dd><p>As ‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’ and ‘<samp class="samp">GRUB_CMDLINE_LINUX_DEFAULT</samp>’, but for NetBSD. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_GNUMACH</samp>’</dt> <dd><p>As ‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’, but for GNU Mach. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_XEN</samp>’</dt> <dt>‘<samp class="samp">GRUB_CMDLINE_XEN_DEFAULT</samp>’</dt> <dd><p>The values of these options are passed to Xen hypervisor Xen menu entries, for all respectively normal entries. </p> </dd> <dt>‘<samp class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE</samp>’</dt> <dt>‘<samp class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT</samp>’</dt> <dd><p>The values of these options replace the values of ‘<samp class="samp">GRUB_CMDLINE_LINUX</samp>’ and ‘<samp class="samp">GRUB_CMDLINE_LINUX_DEFAULT</samp>’ for Linux and Xen menu entries. </p> </dd> <dt>‘<samp class="samp">GRUB_TOP_LEVEL</samp>’</dt> <dt>‘<samp class="samp">GRUB_TOP_LEVEL_XEN</samp>’</dt> <dd><p>This option should be an absolute path to a kernel image. If provided, the image specified will be made the top-level entry if it is found in the scan. </p> </dd> <dt>‘<samp class="samp">GRUB_TOP_LEVEL_OS_PROBER</samp>’</dt> <dd><p>This option should be a line of output from <code class="command">os-prober</code>. As ‘<samp class="samp">GRUB_TOP_LEVEL</samp>’, if provided, the image specified will be made the top-level entry if it is found in the scan. </p> </dd> <dt>‘<samp class="samp">GRUB_EARLY_INITRD_LINUX_CUSTOM</samp>’</dt> <dt>‘<samp class="samp">GRUB_EARLY_INITRD_LINUX_STOCK</samp>’</dt> <dd><p>List of space-separated early initrd images to be loaded from ‘<samp class="samp">/boot</samp>’. This is for loading things like CPU microcode, firmware, ACPI tables, crypto keys, and so on. These early images will be loaded in the order declared, and all will be loaded before the actual functional initrd image. </p> <p>‘<samp class="samp">GRUB_EARLY_INITRD_LINUX_STOCK</samp>’ is for your distribution to declare images that are provided by the distribution. It should not be modified without understanding the consequences. They will be loaded first. </p> <p>‘<samp class="samp">GRUB_EARLY_INITRD_LINUX_CUSTOM</samp>’ is for your custom created images. </p> <p>The default stock images are as follows, though they may be overridden by your distribution: </p><div class="example"> <pre class="example-preformatted">intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio </pre></div> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_LINUX_UUID</samp>’</dt> <dd><p>Normally, <code class="command">grub2-mkconfig</code> will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a ‘<samp class="samp">root=UUID=...</samp>’ kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to ‘<samp class="samp">true</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’</dt> <dd><p>If <code class="command">grub2-mkconfig</code> cannot identify the root filesystem via its universally-unique indentifier (UUID), <code class="command">grub2-mkconfig</code> can use the UUID of the partition containing the filesystem to identify the root filesystem to the Linux kernel via a ‘<samp class="samp">root=PARTUUID=...</samp>’ kernel parameter. This is not as reliable as using the filesystem UUID, but is more reliable than using the Linux device names. When ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ is set to ‘<samp class="samp">false</samp>’, the Linux kernel version must be 2.6.37 (3.10 for systems using the MSDOS partition scheme) or newer. This option defaults to ‘<samp class="samp">true</samp>’. To enable the use of partition UUIDs, set this option to ‘<samp class="samp">false</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_RECOVERY</samp>’</dt> <dd><p>If this option is set to ‘<samp class="samp">true</samp>’, disable the generation of recovery mode menu entries. </p> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_UUID</samp>’</dt> <dd><p>Normally, <code class="command">grub2-mkconfig</code> will generate menu entries that use universally-unique identifiers (UUIDs) to identify various filesystems to search for files. This is usually more reliable, but in some cases it may not be appropriate. To disable this use of UUIDs, set this option to ‘<samp class="samp">true</samp>’. Setting this option to ‘<samp class="samp">true</samp>’, will also set the options ‘<samp class="samp">GRUB_DISABLE_LINUX_UUID</samp>’ and ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ to ‘<samp class="samp">true</samp>’, unless they have been explicilty set to ‘<samp class="samp">false</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_VIDEO_BACKEND</samp>’</dt> <dd><p>If graphical video support is required, either because the ‘<samp class="samp">gfxterm</samp>’ graphical terminal is in use or because ‘<samp class="samp">GRUB_GFXPAYLOAD_LINUX</samp>’ is set, then <code class="command">grub2-mkconfig</code> will normally load all available GRUB video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option. </p> <p>After <code class="command">grub2-install</code> has been run, the available video drivers are listed in <samp class="file">/boot/grub2/video.lst</samp>. </p> </dd> <dt>‘<samp class="samp">GRUB_GFXMODE</samp>’</dt> <dd><p>Set the resolution used on the ‘<samp class="samp">gfxterm</samp>’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘<samp class="samp">auto</samp>’, which tries to select a preferred resolution. See <a class="xref" href="#gfxmode">gfxmode</a>. </p> </dd> <dt>‘<samp class="samp">GRUB_BACKGROUND</samp>’</dt> <dd><p>Set a background image for use with the ‘<samp class="samp">gfxterm</samp>’ graphical terminal. The value of this option must be a file readable by GRUB at boot time, and it must end with <samp class="file">.png</samp>, <samp class="file">.tga</samp>, <samp class="file">.jpg</samp>, or <samp class="file">.jpeg</samp>. The image will be scaled if necessary to fit the screen. Image height and width will be restricted by an artificial limit of 16384. </p> </dd> <dt>‘<samp class="samp">GRUB_THEME</samp>’</dt> <dd><p>Set a theme for use with the ‘<samp class="samp">gfxterm</samp>’ graphical terminal. </p> </dd> <dt>‘<samp class="samp">GRUB_GFXPAYLOAD_LINUX</samp>’</dt> <dd><p>Set to ‘<samp class="samp">text</samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp class="samp">keep</samp>’ to preserve the graphics mode set using ‘<samp class="samp">GRUB_GFXMODE</samp>’, ‘<samp class="samp"><var class="var">width</var>x<var class="var">height</var></samp>’[‘<samp class="samp">x<var class="var">depth</var></samp>’] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See <a class="xref" href="#gfxpayload">gfxpayload</a>. </p> <p>Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ‘<samp class="samp">text</samp>’ and GRUB will tell Linux to boot in normal text mode. </p> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_OS_PROBER</samp>’</dt> <dd><p>Normally, <code class="command">grub2-mkconfig</code> will try to use the external <code class="command">os-prober</code> program, if installed, to discover other operating systems installed on the same system and generate appropriate menu entries for them. Set this option to ‘<samp class="samp">true</samp>’ to disable this. </p> </dd> <dt>‘<samp class="samp">GRUB_OS_PROBER_SKIP_LIST</samp>’</dt> <dd><p>List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it’s <UUID>@<EFI FILE> </p> </dd> <dt>‘<samp class="samp">GRUB_DISABLE_SUBMENU</samp>’</dt> <dd><p>Normally, <code class="command">grub2-mkconfig</code> will generate top level menu entry for the kernel with highest version number and put all other found kernels or alternative menu entries for recovery mode in submenu. For entries returned by <code class="command">os-prober</code> first entry will be put on top level and all others in submenu. If this option is set to ‘<samp class="samp">true</samp>’, flat menu with all entries on top level will be generated instead. Changing this option will require changing existing values of ‘<samp class="samp">GRUB_DEFAULT</samp>’, ‘<samp class="samp">fallback</samp>’ (see <a class="pxref" href="#fallback">fallback</a>) and ‘<samp class="samp">default</samp>’ (see <a class="pxref" href="#default">default</a>) environment variables as well as saved default entry using <code class="command">grub2-set-default</code> and value used with <code class="command">grub2-reboot</code>. </p> </dd> <dt>‘<samp class="samp">GRUB_ENABLE_CRYPTODISK</samp>’</dt> <dd><p>If set to ‘<samp class="samp">y</samp>’, <code class="command">grub2-mkconfig</code> and <code class="command">grub2-install</code> will check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible because GRUB will wait for passphrase to unlock encrypted container. </p> </dd> <dt>‘<samp class="samp">GRUB_INIT_TUNE</samp>’</dt> <dd><p>Play a tune on the speaker when GRUB starts. This is particularly useful for users unable to see the screen. The value of this option is passed directly to <a class="ref" href="#play">play</a>. </p> </dd> <dt>‘<samp class="samp">GRUB_BADRAM</samp>’</dt> <dd><p>If this option is set, GRUB will issue a <a class="ref" href="#badram">badram</a> command to filter out specified regions of RAM. </p> </dd> <dt>‘<samp class="samp">GRUB_PRELOAD_MODULES</samp>’</dt> <dd><p>This option may be set to a list of GRUB module names separated by spaces. Each module will be loaded as early as possible, at the start of <samp class="file">grub.cfg</samp>. </p> </dd> </dl> <p>The following options are still accepted for compatibility with existing configurations, but have better replacements: </p> <dl class="table"> <dt>‘<samp class="samp">GRUB_HIDDEN_TIMEOUT</samp>’</dt> <dd><p>Wait this many seconds before displaying the menu. If <kbd class="key">ESC</kbd> or <kbd class="key">F4</kbd> are pressed, or <kbd class="key">SHIFT</kbd> is held down during that time, display the menu and wait for input according to ‘<samp class="samp">GRUB_TIMEOUT</samp>’. If a hotkey associated with a menu entry is pressed, boot the associated menu entry immediately. If the timeout expires before either of these happens, display the menu for the number of seconds specified in ‘<samp class="samp">GRUB_TIMEOUT</samp>’ before booting the default entry. </p> <p>If you set ‘<samp class="samp">GRUB_HIDDEN_TIMEOUT</samp>’, you should also set ‘<samp class="samp">GRUB_TIMEOUT=0</samp>’ so that the menu is not displayed at all unless <kbd class="key">ESC</kbd> or <kbd class="key">F4</kbd> are pressed, or <kbd class="key">SHIFT</kbd> is held down. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp class="samp">GRUB_TIMEOUT_STYLE=countdown</samp>’ or ‘<samp class="samp">GRUB_TIMEOUT_STYLE=hidden</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_HIDDEN_TIMEOUT_QUIET</samp>’</dt> <dd><p>In conjunction with ‘<samp class="samp">GRUB_HIDDEN_TIMEOUT</samp>’, set this to ‘<samp class="samp">true</samp>’ to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp class="samp">GRUB_TIMEOUT_STYLE=countdown</samp>’. </p> </dd> <dt>‘<samp class="samp">GRUB_HIDDEN_TIMEOUT_BUTTON</samp>’</dt> <dd><p>Variant of ‘<samp class="samp">GRUB_HIDDEN_TIMEOUT</samp>’, used to support vendor-specific power buttons. See <a class="xref" href="#Vendor-power_002don-keys">Using GRUB with vendor power-on keys</a>. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp class="samp">GRUB_TIMEOUT_STYLE=countdown</samp>’ or ‘<samp class="samp">GRUB_TIMEOUT_STYLE=hidden</samp>’. </p> </dd> </dl> <p>For more detailed customisation of <code class="command">grub2-mkconfig</code>’s output, you may edit the scripts in <samp class="file">/etc/grub.d</samp> directly. <samp class="file">/etc/grub.d/40_custom</samp> is particularly useful for adding entire custom menu entries; simply type the menu entries you want to add at the end of that file, making sure to leave at least the first two lines intact. </p> <hr> </div> <div class="section-level-extent" id="Root-Identifcation-Heuristics"> <div class="nav-panel"> <p> Next: <a href="#Shell_002dlike-scripting" accesskey="n" rel="next">Writing full configuration files directly</a>, Previous: <a href="#Simple-configuration" accesskey="p" rel="prev">Simple configuration handling</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Writing your own configuration file</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Root-Identifcation-Heuristics-1"><span>6.2 Root Identifcation Heuristics<a class="copiable-link" href="#Root-Identifcation-Heuristics-1"> ¶</a></span></h3> <p>If the target operating system uses the Linux kernel, <code class="command">grub2-mkconfig</code> attempts to identify the root file system via a heuristic algoirthm. This algorithm selects the identification method of the root file system by considering three factors. The first is if an initrd for the target operating system is also present. The second is ‘<samp class="samp">GRUB_DISABLE_LINUX_UUID</samp>’ and if set to ‘<samp class="samp">true</samp>’, prevents <code class="command">grub2-mkconfig</code> from identifying the root file system by its UUID. The third is ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ and if set to ‘<samp class="samp">true</samp>’, prevents <code class="command">grub2-mkconfig</code> from identifying the root file system via the UUID of its enclosing partition. If the variables are assigned any other value, that value is considered equivalent to ‘<samp class="samp">false</samp>’. The variables are also considered to be set to ‘<samp class="samp">false</samp>’ if they are not set. </p> <p>When booting, the Linux kernel will delegate the task of mounting the root filesystem to the initrd. Most initrd images determine the root file system by checking the Linux kernel’s command-line for the ‘<samp class="samp">root</samp>’ key and use its value as the identification method of the root file system. To improve the reliability of booting, most initrd images also allow the root file system to be identified by its UUID. Because of this behavior, the <code class="command">grub2-mkconfig</code> command will set ‘<samp class="samp">root</samp>’ to ‘<samp class="samp">root=UUID=...</samp>’ to provide the initrd with the filesystem UUID of the root file system. </p> <p>If no initrd is detected or ‘<samp class="samp">GRUB_DISABLE_LINUX_UUID</samp>’ is set to ‘<samp class="samp">true</samp>’ then <code class="command">grub2-command</code> will identify the root filesystem by setting the kernel command-line variable ‘<samp class="samp">root</samp>’ to ‘<samp class="samp">root=PARTUUID=...</samp>’ unless ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ is also set to ‘<samp class="samp">true</samp>’. If ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ is also set to ‘<samp class="samp">true</samp>’, <code class="command">grub2-command</code> will identify by its Linux device name. </p> <p>The following table summarizes the behavior of the <code class="command">grub2-mkconfig</code> command. </p> <table class="multitable"> <thead><tr><th>Initrd detected</th><th>GRUB_DISABLE_LINUX_PARTUUID Set To</th><th>GRUB_DISABLE_LINUX_UUID Set To</th><th>Linux Root ID Method</th></tr></thead> <tbody><tr><td>false</td><td>false</td><td>false</td><td>part UUID</td></tr> <tr><td>false</td><td>false</td><td>true</td><td>part UUID</td></tr> <tr><td>false</td><td>true</td><td>false</td><td>dev name</td></tr> <tr><td>false</td><td>true</td><td>true</td><td>dev name</td></tr> <tr><td>true</td><td>false</td><td>false</td><td>fs UUID</td></tr> <tr><td>true</td><td>false</td><td>true</td><td>part UUID</td></tr> <tr><td>true</td><td>true</td><td>false</td><td>fs UUID</td></tr> <tr><td>true</td><td>true</td><td>true</td><td>dev name</td></tr> </tbody> </table> <p>Remember, ‘<samp class="samp">GRUB_DISABLE_LINUX_PARTUUID</samp>’ and ‘<samp class="samp">GRUB_DISABLE_LINUX_UUID</samp>’ are also considered to be set to ‘<samp class="samp">true</samp>’ and ‘<samp class="samp">false</samp>’, respectively, when they are unset. </p> <hr> </div> <div class="section-level-extent" id="Shell_002dlike-scripting"> <div class="nav-panel"> <p> Next: <a href="#Multi_002dboot-manual-config" accesskey="n" rel="next">Multi-boot manual config</a>, Previous: <a href="#Root-Identifcation-Heuristics" accesskey="p" rel="prev">Root Identifcation Heuristics</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Writing your own configuration file</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Writing-full-configuration-files-directly"><span>6.3 Writing full configuration files directly<a class="copiable-link" href="#Writing-full-configuration-files-directly"> ¶</a></span></h3> <p><samp class="file">grub.cfg</samp> is written in GRUB’s built-in scripting language, which has a syntax quite similar to that of GNU Bash and other Bourne shell derivatives. </p> <h3 class="heading" id="Words"><span>Words<a class="copiable-link" href="#Words"> ¶</a></span></h3> <p>A <em class="dfn">word</em> is a sequence of characters considered as a single unit by GRUB. Words are separated by <em class="dfn">metacharacters</em>, which are the following plus space, tab, and newline: </p> <div class="example"> <pre class="example-preformatted">{ } | & $ ; < > </pre></div> <p>Quoting may be used to include metacharacters in words; see below. </p> <h3 class="heading" id="Reserved-words"><span>Reserved words<a class="copiable-link" href="#Reserved-words"> ¶</a></span></h3> <p>Reserved words have a special meaning to GRUB. The following words are recognised as reserved when unquoted and either the first word of a simple command or the third word of a <code class="code">for</code> command: </p> <div class="example"> <pre class="example-preformatted">! [[ ]] { } case do done elif else esac fi for function if in menuentry select then time until while </pre></div> <p>Not all of these reserved words have a useful purpose yet; some are reserved for future expansion. </p> <h3 class="heading" id="Quoting"><span>Quoting<a class="copiable-link" href="#Quoting"> ¶</a></span></h3> <p>Quoting is used to remove the special meaning of certain characters or words. It can be used to treat metacharacters as part of a word, to prevent reserved words from being recognised as such, and to prevent variable expansion. </p> <p>There are three quoting mechanisms: the escape character, single quotes, and double quotes. </p> <p>A non-quoted backslash (\) is the <em class="dfn">escape character</em>. It preserves the literal value of the next character that follows, with the exception of newline. </p> <p>Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. </p> <p>Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of ‘<samp class="samp">$</samp>’ and ‘<samp class="samp">\</samp>’. The ‘<samp class="samp">$</samp>’ character retains its special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: ‘<samp class="samp">$</samp>’, ‘<samp class="samp">"</samp>’, ‘<samp class="samp">\</samp>’, or newline. A backslash-newline pair is treated as a line continuation (that is, it is removed from the input stream and effectively ignored<a class="footnote" id="DOCF7" href="#FOOT7"><sup>7</sup></a>). A double quote may be quoted within double quotes by preceding it with a backslash. </p> <h3 class="heading" id="Variable-expansion"><span>Variable expansion<a class="copiable-link" href="#Variable-expansion"> ¶</a></span></h3> <p>The ‘<samp class="samp">$</samp>’ character introduces variable expansion. The variable name to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. </p> <p>Normal variable names begin with an alphabetic character, followed by zero or more alphanumeric characters. These names refer to entries in the GRUB environment (see <a class="pxref" href="#Environment">GRUB environment variables</a>). </p> <p>Positional variable names consist of one or more digits. They represent parameters passed to function calls, with ‘<samp class="samp">$1</samp>’ representing the first parameter, and so on. </p> <p>The special variable name ‘<samp class="samp">?</samp>’ expands to the exit status of the most recently executed command. When positional variable names are active, other special variable names ‘<samp class="samp">@</samp>’, ‘<samp class="samp">*</samp>’ and ‘<samp class="samp">#</samp>’ are defined and they expand to all positional parameters with necessary quoting, positional parameters without any quoting, and positional parameter count respectively. </p> <h3 class="heading" id="Comments"><span>Comments<a class="copiable-link" href="#Comments"> ¶</a></span></h3> <p>A word beginning with ‘<samp class="samp">#</samp>’ causes that word and all remaining characters on that line to be ignored. </p> <h3 class="heading" id="Simple-commands"><span>Simple commands<a class="copiable-link" href="#Simple-commands"> ¶</a></span></h3> <p>A <em class="dfn">simple command</em> is a sequence of words separated by spaces or tabs and terminated by a semicolon or a newline. The first word specifies the command to be executed. The remaining words are passed as arguments to the invoked command. </p> <p>The return value of a simple command is its exit status. If the reserved word <code class="code">!</code> precedes the command, then the return value is instead the logical negation of the command’s exit status. </p> <h3 class="heading" id="Compound-commands"><span>Compound commands<a class="copiable-link" href="#Compound-commands"> ¶</a></span></h3> <p>A <em class="dfn">compound command</em> is one of the following: </p> <dl class="table"> <dt>for <var class="var">name</var> in <var class="var">word</var> …; do <var class="var">list</var>; done</dt> <dd><p>The list of words following <code class="code">in</code> is expanded, generating a list of items. The variable <var class="var">name</var> is set to each element of this list in turn, and <var class="var">list</var> is executed each time. The return value is the exit status of the last command that executes. If the expansion of the items following <code class="code">in</code> results in an empty list, no commands are executed, and the return status is 0. </p> </dd> <dt>if <var class="var">list</var>; then <var class="var">list</var>; [elif <var class="var">list</var>; then <var class="var">list</var>;] … [else <var class="var">list</var>;] fi</dt> <dd><p>The <code class="code">if</code> <var class="var">list</var> is executed, where <var class="var">list</var> is a series of <em class="dfn">simple command</em>s separated by a ";". If its exit status of the last command is zero, the <code class="code">then</code> <var class="var">list</var> is executed. Otherwise, each <code class="code">elif</code> <var class="var">list</var> is executed in turn, and if its last command’s exit status is zero, the corresponding <code class="code">then</code> <var class="var">list</var> is executed and the command completes. Otherwise, the <code class="code">else</code> <var class="var">list</var> is executed, if present. The exit status is the exit status of the last command executed, or zero if no condition tested true. </p> </dd> <dt>while <var class="var">cond</var>; do <var class="var">list</var>; done</dt> <dt>until <var class="var">cond</var>; do <var class="var">list</var>; done</dt> <dd><p>The <code class="code">while</code> command continuously executes the <code class="code">do</code> <var class="var">list</var> as long as the last command in <var class="var">cond</var> returns an exit status of zero, where <var class="var">cond</var> is a list of <em class="dfn">simple command</em>s separated by a ";". The <code class="code">until</code> command is identical to the <code class="code">while</code> command, except that the test is negated; the <code class="code">do</code> <var class="var">list</var> is executed as long as the last command in <var class="var">cond</var> returns a non-zero exit status. The exit status of the <code class="code">while</code> and <code class="code">until</code> commands is the exit status of the last <code class="code">do</code> <var class="var">list</var> command executed, or zero if none was executed. </p> </dd> <dt>function <var class="var">name</var> { <var class="var">command</var>; … }</dt> <dd><p>This defines a function named <var class="var">name</var>. The <em class="dfn">body</em> of the function is the list of commands within braces, each of which must be terminated with a semicolon or a newline. This list of commands will be executed whenever <var class="var">name</var> is specified as the name of a simple command. Function definitions do not affect the exit status in <code class="code">$?</code>. When executed, the exit status of a function is the exit status of the last command executed in the body. </p> </dd> <dt>menuentry <var class="var">title</var> [<samp class="option">--class=class</samp> …] [<samp class="option">--users=users</samp>] [<samp class="option">--unrestricted</samp>] [<samp class="option">--hotkey=key</samp>] [<samp class="option">--id=id</samp>] { <var class="var">command</var>; … }</dt> <dd><p>See <a class="xref" href="#menuentry">menuentry</a>. </p></dd> </dl> <h3 class="heading" id="Built_002din-Commands"><span>Built-in Commands<a class="copiable-link" href="#Built_002din-Commands"> ¶</a></span></h3> <p>Some built-in commands are also provided by GRUB script to help script writers perform actions that are otherwise not possible. For example, these include commands to jump out of a loop without fully completing it, etc. </p> <dl class="table"> <dt>break [<code class="code">n</code>]</dt> <dd><p>Exit from within a <code class="code">for</code>, <code class="code">while</code>, or <code class="code">until</code> loop. If <code class="code">n</code> is specified, break <code class="code">n</code> levels. <code class="code">n</code> must be greater than or equal to 1. If <code class="code">n</code> is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless <code class="code">n</code> is not greater than or equal to 1. </p> </dd> <dt>continue [<code class="code">n</code>]</dt> <dd><p>Resume the next iteration of the enclosing <code class="code">for</code>, <code class="code">while</code> or <code class="code">until</code> loop. If <code class="code">n</code> is specified, resume at the <code class="code">n</code>th enclosing loop. <code class="code">n</code> must be greater than or equal to 1. If <code class="code">n</code> is greater than the number of enclosing loops, the last enclosing loop (the <em class="dfn">top-level</em> loop) is resumed. The return value is 0 unless <code class="code">n</code> is not greater than or equal to 1. </p> </dd> <dt>return [<code class="code">n</code>]</dt> <dd><p>Causes a function to exit with the return value specified by <code class="code">n</code>. If <code class="code">n</code> is omitted, the return status is that of the last command executed in the function body. If used outside a function the return status is false. </p> </dd> <dt>setparams [<code class="code">arg</code>] …</dt> <dd><p>Replace positional parameters starting with <code class="code">$1</code> with arguments to <code class="command">setparams</code>. </p> </dd> <dt>shift [<code class="code">n</code>]</dt> <dd><p>The positional parameters from <code class="code">n</code>+1 … are renamed to <code class="code">$1</code>…. Parameters represented by the numbers <code class="code">$#</code> down to <code class="code">$#</code>-<code class="code">n</code>+1 are unset. <code class="code">n</code> must be a non-negative number less than or equal to <code class="code">$#</code>. If <code class="code">n</code> is 0, no parameters are changed. If <code class="code">n</code> is not given, it is assumed to be 1. If <code class="code">n</code> is greater than <code class="code">$#</code>, the positional parameters are not changed. The return status is greater than zero if <code class="code">n</code> is greater than <code class="code">$#</code> or less than zero; otherwise 0. </p> </dd> </dl> <hr> </div> <div class="section-level-extent" id="Multi_002dboot-manual-config"> <div class="nav-panel"> <p> Next: <a href="#Embedded-configuration" accesskey="n" rel="next">Embedding a configuration file into GRUB</a>, Previous: <a href="#Shell_002dlike-scripting" accesskey="p" rel="prev">Writing full configuration files directly</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Writing your own configuration file</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Multi_002dboot-manual-config-1"><span>6.4 Multi-boot manual config<a class="copiable-link" href="#Multi_002dboot-manual-config-1"> ¶</a></span></h3> <p>Currently autogenerating config files for multi-boot environments depends on os-prober and has several shortcomings. While fixing it is scheduled for the next release, meanwhile you can make use of the power of GRUB syntax and do it yourself. A possible configuration is detailed here, feel free to adjust to your needs. </p> <p>First create a separate GRUB partition, big enough to hold GRUB. Some of the following entries show how to load OS installer images from this same partition, for that you obviously need to make the partition large enough to hold those images as well. Mount this partition on/mnt/boot and disable GRUB in all OSes and manually install self-compiled latest GRUB with: </p> <p><code class="code">grub2-install --boot-directory=/mnt/boot /dev/sda</code> </p> <p>In all the OSes install GRUB tools but disable installing GRUB in bootsector, so you’ll have menu.lst and grub.cfg available for use. Also disable os-prober use by setting: </p> <p><code class="code">GRUB_DISABLE_OS_PROBER=true</code> </p> <p>in /etc/default/grub </p> <p>Then write a grub.cfg (/mnt/boot/grub2/grub.cfg): </p> <div class="example"> <pre class="example-preformatted"> menuentry "OS using grub2" { insmod xfs search --set=root --label OS1 --hint hd0,msdos8 configfile /boot/grub2/grub.cfg } menuentry "OS using grub2-legacy" { insmod ext2 search --set=root --label OS2 --hint hd0,msdos6 legacy_configfile /boot/grub2/menu.lst } menuentry "Windows XP" { insmod ntfs search --set=root --label WINDOWS_XP --hint hd0,msdos1 ntldr /ntldr } menuentry "Windows 7" { insmod ntfs search --set=root --label WINDOWS_7 --hint hd0,msdos2 ntldr /bootmgr } menuentry "FreeBSD" { insmod zfs search --set=root --label freepool --hint hd0,msdos7 kfreebsd /freebsd@/boot/kernel/kernel kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd set kFreeBSD.hw.psm.synaptics_support=1 } menuentry "experimental GRUB" { search --set=root --label GRUB --hint hd0,msdos5 multiboot /experimental/grub/i386-pc/core.img } menuentry "Fedora 16 installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img } menuentry "Fedora rawhide installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img } menuentry "Debian sid installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz } </pre></div> <p>Notes: </p><ul class="itemize mark-bullet"> <li>Argument to search after –label is FS LABEL. You can also use UUIDs with –fs-uuid UUID instead of –label LABEL. You could also use direct <code class="code">root=hd0,msdosX</code> but this is not recommended due to device name instability. </li></ul> <hr> </div> <div class="section-level-extent" id="Embedded-configuration"> <div class="nav-panel"> <p> Previous: <a href="#Multi_002dboot-manual-config" accesskey="p" rel="prev">Multi-boot manual config</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Writing your own configuration file</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Embedding-a-configuration-file-into-GRUB"><span>6.5 Embedding a configuration file into GRUB<a class="copiable-link" href="#Embedding-a-configuration-file-into-GRUB"> ¶</a></span></h3> <p>GRUB supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. <code class="command">grub2-install</code> uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing <samp class="file">/boot/grub</samp>, in which case it needs to use the <code class="command">search</code> command (see <a class="pxref" href="#search">search</a>) to find <samp class="file">/boot/grub</samp>. </p> <p>To embed a configuration file, use the <samp class="option">-c</samp> option to <code class="command">grub2-mkimage</code>. The file is copied into the core image, so it may reside anywhere on the file system, and may be removed after running <code class="command">grub2-mkimage</code>. </p> <p>After the embedded configuration file (if any) is executed, GRUB will load the ‘<samp class="samp">normal</samp>’ module (see <a class="pxref" href="#normal">normal</a>), which will then read the real configuration file from <samp class="file">$prefix/grub.cfg</samp>. By this point, the <code class="code">root</code> variable will also have been set to the root device name. For example, <code class="code">prefix</code> might be set to ‘<samp class="samp">(hd0,1)/boot/grub</samp>’, and <code class="code">root</code> might be set to ‘<samp class="samp">hd0,1</samp>’. Thus, in most cases, the embedded configuration file only needs to set the <code class="code">prefix</code> and <code class="code">root</code> variables, and then drop through to GRUB’s normal processing. A typical example of this might look like this: </p> <div class="example"> <div class="group"><pre class="example-preformatted">search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root set prefix=($root)/boot/grub </pre></div></div> <p>(The ‘<samp class="samp">search_fs_uuid</samp>’ module must be included in the core image for this example to work.) </p> <p>In more complex cases, it may be useful to read other configuration files directly from the embedded configuration file. This allows such things as reading files not called <samp class="file">grub.cfg</samp>, or reading files from a directory other than that where GRUB’s loadable modules are installed. To do this, include the ‘<samp class="samp">configfile</samp>’ and ‘<samp class="samp">normal</samp>’ modules in the core image, and embed a configuration file that uses the <code class="command">configfile</code> command to load another file. The following example of this also requires the <code class="command">echo</code>, <code class="command">search_label</code>, and <code class="command">test</code> modules to be included in the core image: </p> <div class="example"> <div class="group"><pre class="example-preformatted">search.fs_label grub root if [ -e /boot/grub2/example/test1.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub2/example/test1.cfg else if [ -e /boot/grub2/example/test2.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub2/example/test2.cfg else echo "Could not find an example configuration file!" fi fi </pre></div></div> <p>The embedded configuration file may not contain menu entries directly, but may only read them from elsewhere using <code class="command">configfile</code>. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Theme-file-format"> <div class="nav-panel"> <p> Next: <a href="#Network" accesskey="n" rel="next">Booting GRUB from the network</a>, Previous: <a href="#Configuration" accesskey="p" rel="prev">Writing your own configuration file</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Theme-file-format-1"><span>7 Theme file format<a class="copiable-link" href="#Theme-file-format-1"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#Introduction-1" accesskey="1">Introduction</a></li> <li><a href="#Theme-Elements" accesskey="2">Theme Elements</a></li> <li><a href="#Theme-File-Manual" accesskey="3">Theme File Manual</a></li> </ul> <div class="section-level-extent" id="Introduction-1"> <h3 class="section"><span>7.1 Introduction<a class="copiable-link" href="#Introduction-1"> ¶</a></span></h3> <p>The GRUB graphical menu supports themes that can customize the layout and appearance of the GRUB boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance using colors, fonts, and images. Example is available in docs/example_theme.txt </p> </div> <div class="section-level-extent" id="Theme-Elements"> <h3 class="section"><span>7.2 Theme Elements<a class="copiable-link" href="#Theme-Elements"> ¶</a></span></h3> <ul class="mini-toc"> <li><a href="#Colors" accesskey="1">Colors</a></li> <li><a href="#Fonts" accesskey="2">Fonts</a></li> <li><a href="#Progress-Bar" accesskey="3">Progress Bar</a></li> <li><a href="#Circular-Progress-Indicator" accesskey="4">Circular Progress Indicator</a></li> <li><a href="#Labels" accesskey="5">Labels</a></li> <li><a href="#Boot-Menu" accesskey="6">Boot Menu</a></li> <li><a href="#Styled-Boxes" accesskey="7">Styled Boxes</a></li> <li><a href="#Creating-Styled-Box-Images" accesskey="8">Creating Styled Box Images</a></li> </ul> <div class="subsection-level-extent" id="Colors"> <h4 class="subsection"><span>7.2.1 Colors<a class="copiable-link" href="#Colors"> ¶</a></span></h4> <p>Colors can be specified in several ways: </p> <ul class="itemize mark-bullet"> <li>HTML-style “#RRGGBB” or “#RGB” format, where *R*, *G*, and *B* are hexadecimal digits (e.g., “#8899FF”) </li><li>as comma-separated decimal RGB values (e.g., “128, 128, 255”) </li><li>with “SVG 1.0 color names” (e.g., “cornflowerblue”) which must be specified in lowercase. </li></ul> </div> <div class="subsection-level-extent" id="Fonts"> <h4 class="subsection"><span>7.2.2 Fonts<a class="copiable-link" href="#Fonts"> ¶</a></span></h4> <p>The fonts GRUB uses “PFF2 font format” bitmap fonts. Fonts are specified with full font names. Currently there is no provision for a preference list of fonts, or deriving one font from another. Fonts are loaded with the “loadfont” command in GRUB (<a class="ref" href="#loadfont">loadfont</a>). To see the list of loaded fonts, execute the “lsfonts” command (<a class="ref" href="#lsfonts">lsfonts</a>). If there are too many fonts to fit on screen, do “set pager=1” before executing “lsfonts”. </p> </div> <div class="subsection-level-extent" id="Progress-Bar"> <h4 class="subsection"><span>7.2.3 Progress Bar<a class="copiable-link" href="#Progress-Bar"> ¶</a></span></h4> <div class="float" id="Pixmap_002dstyled-progress-bar"> <div class="type-number-float"><p><strong class="strong">Figure 7.1</strong></p></div></div> <div class="float" id="Plain-progress-bar_002c-drawn-with-solid-color_002e"> <div class="type-number-float"><p><strong class="strong">Figure 7.2</strong></p></div></div> <p>Progress bars are used to display the remaining time before GRUB boots the default menu entry. To create a progress bar that will display the remaining time before automatic boot, simply create a “progress_bar” component with the id “__timeout__”. This indicates to GRUB that the progress bar should be updated as time passes, and it should be made invisible if the countdown to automatic boot is interrupted by the user. </p> <p>Progress bars may optionally have text displayed on them. This text is controlled by variable “text” which contains a printf template with the only argument %d is the number of seconds remaining. Additionally special values “@TIMEOUT_NOTIFICATION_SHORT@”, “@TIMEOUT_NOTIFICATION_MIDDLE@”, “@TIMEOUT_NOTIFICATION_LONG@” are replaced with standard and translated templates. </p> </div> <div class="subsection-level-extent" id="Circular-Progress-Indicator"> <h4 class="subsection"><span>7.2.4 Circular Progress Indicator<a class="copiable-link" href="#Circular-Progress-Indicator"> ¶</a></span></h4> <p>The circular progress indicator functions similarly to the progress bar. When given an id of “__timeout__”, GRUB updates the circular progress indicator’s value to indicate the time remaining. For the circular progress indicator, there are two images used to render it: the *center* image, and the *tick* image. The center image is rendered in the center of the component, while the tick image is used to render each mark along the circumference of the indicator. </p> </div> <div class="subsection-level-extent" id="Labels"> <h4 class="subsection"><span>7.2.5 Labels<a class="copiable-link" href="#Labels"> ¶</a></span></h4> <p>Text labels can be placed on the boot screen. The font, color, and horizontal alignment can be specified for labels. If a label is given the id “__timeout__”, then the “text” property for that label is also updated with a message informing the user of the number of seconds remaining until automatic boot. This is useful in case you want the text displayed somewhere else instead of directly on the progress bar. </p> </div> <div class="subsection-level-extent" id="Boot-Menu"> <h4 class="subsection"><span>7.2.6 Boot Menu<a class="copiable-link" href="#Boot-Menu"> ¶</a></span></h4> <p>The boot menu where GRUB displays the menu entries from the “grub.cfg” file. It is a list of items, where each item has a title and an optional icon. The icon is selected based on the *classes* specified for the menu entry. If there is a PNG file named “myclass.png” in the “grub/themes/icons” directory, it will be displayed for items which have the class *myclass*. The boot menu can be customized in several ways, such as the font and color used for the menu entry title, and by specifying styled boxes for the menu itself and for the selected item highlight. </p> </div> <div class="subsection-level-extent" id="Styled-Boxes"> <h4 class="subsection"><span>7.2.7 Styled Boxes<a class="copiable-link" href="#Styled-Boxes"> ¶</a></span></h4> <p>One of the most important features for customizing the layout is the use of *styled boxes*. A styled box is composed of 9 rectangular (and potentially empty) regions, which are used to seamlessly draw the styled box on screen: </p> <table class="multitable"> <tbody><tr><td width="30%">Northwest (nw)</td><td width="30%">North (n)</td><td width="30%">Northeast (ne)</td></tr> <tr><td width="30%">West (w)</td><td width="30%">Center (c)</td><td width="30%">East (e)</td></tr> <tr><td width="30%">Southwest (sw)</td><td width="30%">South (s)</td><td width="30%">Southeast (se)</td></tr> </tbody> </table> <p>To support any size of box on screen, the center slice and the slices for the top, bottom, and sides are all scaled to the correct size for the component on screen, using the following rules: </p> <ol class="enumerate"> <li> The edge slices (north, south, east, and west) are scaled in the direction of the edge they are adjacent to. For instance, the west slice is scaled vertically. </li><li> The corner slices (northwest, northeast, southeast, and southwest) are not scaled. </li><li> The center slice is scaled to fill the remaining space in the middle. </li></ol> <p>As an example of how an image might be sliced up, consider the styled box used for a terminal view. </p> <div class="float" id="An-example-of-the-slices-_0028in-red_0029-used-for-a-terminal-window_002e-This-drawing-was-created-and-sliced-in-Inkscape_005f_002c-as-the-next-section-explains_002e"> <div class="type-number-float"><p><strong class="strong">Figure 7.3</strong></p></div></div> </div> <div class="subsection-level-extent" id="Creating-Styled-Box-Images"> <h4 class="subsection"><span>7.2.8 Creating Styled Box Images<a class="copiable-link" href="#Creating-Styled-Box-Images"> ¶</a></span></h4> <p>The Inkscape_ scalable vector graphics editor is a very useful tool for creating styled box images. One process that works well for slicing a drawing into the necessary image slices is: </p> <ol class="enumerate"> <li> Create or open the drawing you’d like use. </li><li> Create a new layer on the top of the layer stack. Make it visible. Select this layer as the current layer. </li><li> Draw 9 rectangles on your drawing where you’d like the slices to be. Clear the fill option, and set the stroke to 1 pixel wide solid stroke. The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the GRUB menu. You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely. </li><li> Right click on the center slice rectangle and choose Object Properties. Change the "Id" to “slice_c“ and click Set. Repeat this for the remaining 8 rectangles, giving them Id values of “slice_n“, “slice_ne“, “slice_e“, and so on according to the location. </li><li> Save the drawing. </li><li> Select all the slice rectangles. With the slice layer selected, you can simply press Ctrl+A to select all rectangles. The status bar should indicate that 9 rectangles are selected. </li><li> Click the layer hide icon for the slice layer in the layer palette. The rectangles will remain selected, even though they are hidden. </li><li> Choose File | Export Bitmap and check the *Batch export 9 selected objects* box. Make sure that *Hide all except selected* is unchecked. click *Export*. This will create PNG files in the same directory as the drawing, named after the slices. These can now be used for a styled box in a GRUB theme. </li></ol> </div> </div> <div class="section-level-extent" id="Theme-File-Manual"> <h3 class="section"><span>7.3 Theme File Manual<a class="copiable-link" href="#Theme-File-Manual"> ¶</a></span></h3> <p>The theme file is a plain text file. Lines that begin with “#“ are ignored and considered comments. (Note: This may not be the case if the previous line ended where a value was expected.) </p> <p>The theme file contains two types of statements: </p><ol class="enumerate"> <li> Global properties. </li><li> Component construction. </li></ol> <ul class="mini-toc"> <li><a href="#Global-Properties" accesskey="1">Global Properties</a></li> <li><a href="#Format" accesskey="2">Format</a></li> <li><a href="#Global-Property-List" accesskey="3">Global Property List</a></li> <li><a href="#Component-Construction" accesskey="4">Component Construction</a></li> <li><a href="#Component-List" accesskey="5">Component List</a></li> <li><a href="#Common-properties" accesskey="6">Common properties</a></li> </ul> <div class="subsection-level-extent" id="Global-Properties"> <h4 class="subsection"><span>7.3.1 Global Properties<a class="copiable-link" href="#Global-Properties"> ¶</a></span></h4> </div> <div class="subsection-level-extent" id="Format"> <h4 class="subsection"><span>7.3.2 Format<a class="copiable-link" href="#Format"> ¶</a></span></h4> <p>Global properties are specified with the simple format: </p><ul class="itemize mark-bullet"> <li>name1: value1 </li><li>name2: "value which may contain spaces" </li><li>name3: #88F </li></ul> <p>In this example, name3 is assigned a color value. </p> </div> <div class="subsection-level-extent" id="Global-Property-List"> <h4 class="subsection"><span>7.3.3 Global Property List<a class="copiable-link" href="#Global-Property-List"> ¶</a></span></h4> <table class="multitable"> <tbody><tr><td width="30%">title-text</td><td width="60%">Specifies the text to display at the top center of the screen as a title.</td></tr> <tr><td width="30%">title-font</td><td width="60%">Defines the font used for the title message at the top of the screen.</td></tr> <tr><td width="30%">title-color</td><td width="60%">Defines the color of the title message.</td></tr> <tr><td width="30%">message-font</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">message-color</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">message-bg-color</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">desktop-image</td><td width="60%">Specifies the image to use as the background. It will be scaled to fit the screen size or proportionally scaled depending on the scale method.</td></tr> <tr><td width="30%">desktop-image-scale-method</td><td width="60%">Specifies the scaling method for the *desktop-image*. Options are “stretch“, “crop“, “padding“, “fitwidth“, “fitheight“. “stretch“ for fitting the screen size. Otherwise it is proportional scaling of a part of *desktop-image* to the part of the screen. “crop“ part of the *desktop-image* will be proportionally scaled to fit the screen sizes. “padding“ the entire *desktop-image* will be contained on the screen. “fitwidth“ for fitting the *desktop-image*’s width with screen width. “fitheight“ for fitting the *desktop-image*’s height with the screen height. Default is “stretch“.</td></tr> <tr><td width="30%">desktop-image-h-align</td><td width="60%">Specifies the horizontal alignment of the *desktop-image* if *desktop-image-scale-method* isn’t equeal to “stretch“. Options are “left“, “center“, “right“. Default is “center“.</td></tr> <tr><td width="30%">desktop-image-v-align</td><td width="60%">Specifies the vertical alignment of the *desktop-image* if *desktop-image-scale-method* isn’t equeal to “stretch“. Options are “top“, “center“, “bottom“. Default is “center“.</td></tr> <tr><td width="30%">desktop-color</td><td width="60%">Specifies the color for the background if *desktop-image* is not specified.</td></tr> <tr><td width="30%">terminal-box</td><td width="60%">Specifies the file name pattern for the styled box slices used for the command line terminal window. For example, “terminal-box: terminal_*.png“ will use the images “terminal_c.png“ as the center area, “terminal_n.png“ as the north (top) edge, “terminal_nw.png“ as the northwest (upper left) corner, and so on. If the image for any slice is not found, it will simply be left empty.</td></tr> <tr><td width="30%">terminal-border</td><td width="60%">Specifies the border width of the terminal window.</td></tr> <tr><td width="30%">terminal-left</td><td width="60%">Specifies the left coordinate of the terminal window.</td></tr> <tr><td width="30%">terminal-top</td><td width="60%">Specifies the top coordinate of the terminal window.</td></tr> <tr><td width="30%">terminal-width</td><td width="60%">Specifies the width of the terminal window.</td></tr> <tr><td width="30%">terminal-height</td><td width="60%">Specifies the height of the terminal window.</td></tr> </tbody> </table> </div> <div class="subsection-level-extent" id="Component-Construction"> <h4 class="subsection"><span>7.3.4 Component Construction<a class="copiable-link" href="#Component-Construction"> ¶</a></span></h4> <p>Greater customizability comes is provided by components. A tree of components forms the user interface. *Containers* are components that can contain other components, and there is always a single root component which is an instance of a *canvas* container. </p> <p>Components are created in the theme file by prefixing the type of component with a ’+’ sign: </p> <p><code class="code"> + label { text="GRUB" font="aqui 11" color="#8FF" } </code> </p> <p>properties of a component are specified as "name = value" (whitespace surrounding tokens is optional and is ignored) where *value* may be: </p><ul class="itemize mark-bullet"> <li>a single word (e.g., “align = center“, “color = #FF8080“), </li><li>a quoted string (e.g., “text = "Hello, World!"“), or </li><li>a tuple (e.g., “preferred_size = (120, 80)“). </li></ul> </div> <div class="subsection-level-extent" id="Component-List"> <h4 class="subsection"><span>7.3.5 Component List<a class="copiable-link" href="#Component-List"> ¶</a></span></h4> <p>The following is a list of the components and the properties they support. </p> <ul class="itemize mark-bullet"> <li>label A label displays a line of text. <p>Properties: </p><table class="multitable"> <tbody><tr><td width="20%">id</td><td width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="20%">text</td><td width="70%">The text to display. If “id“ is set to “__timeout__“ and no “text“ property is set then the amount of seconds will be shown. If set to “@KEYMAP_SHORT@“, “@KEYMAP_MIDDLE@“ or “@KEYMAP_LONG@“ then predefined hotkey information will be shown.</td></tr> <tr><td width="20%">font</td><td width="70%">The font to use for text display.</td></tr> <tr><td width="20%">color</td><td width="70%">The color of the text.</td></tr> <tr><td width="20%">align</td><td width="70%">The horizontal alignment of the text within the component. Options are “left“, “center“ and “right“.</td></tr> <tr><td width="20%">visible</td><td width="70%">Set to “false“ to hide the label.</td></tr> </tbody> </table> </li><li>image A component that displays an image. The image is scaled to fit the component. <p>Properties: </p> <table class="multitable"> <tbody><tr><td width="20%">file</td><td width="70%">The full path to the image file to load.</td></tr> </tbody> </table> </li><li>progress_bar Displays a horizontally oriented progress bar. It can be rendered using simple solid filled rectangles, or using a pair of pixmap styled boxes. <p>Properties: </p> <table class="multitable"> <tbody><tr><td width="20%">id</td><td width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="20%">fg_color</td><td width="70%">The foreground color for plain solid color rendering.</td></tr> <tr><td width="20%">bg_color</td><td width="70%">The background color for plain solid color rendering.</td></tr> <tr><td width="20%">border_color</td><td width="70%">The border color for plain solid color rendering.</td></tr> <tr><td width="20%">text_color</td><td width="70%">The text color.</td></tr> <tr><td width="20%">bar_style</td><td width="70%">The styled box specification for the frame of the progress bar. Example: “progress_frame_*.png“ If the value is equal to “highlight_style“ then no styled boxes will be shown.</td></tr> <tr><td width="20%">highlight_style</td><td width="70%">The styled box specification for the highlighted region of the progress bar. This box will be used to paint just the highlighted region of the bar, and will be increased in size as the bar nears completion. Example: “progress_hl_*.png“. If the value is equal to “bar_style“ then no styled boxes will be shown.</td></tr> <tr><td width="20%">highlight_overlay</td><td width="70%">If this option is set to “true“ then the highlight box side slices (every slice except the center slice) will overlay the frame box side slices. And the center slice of the highlight box can move all the way (from top to bottom), being drawn on the center slice of the frame box. That way we can make a progress bar with round-shaped edges so there won’t be a free space from the highlight to the frame in top and bottom scrollbar positions. Default is “false“.</td></tr> <tr><td width="20%">font</td><td width="70%">The font to use for progress bar.</td></tr> <tr><td width="20%">text</td><td width="70%">The text to display on the progress bar. If the progress bar’s ID is set to “__timeout__“ and the value of this property is set to “@TIMEOUT_NOTIFICATION_SHORT@“, “@TIMEOUT_NOTIFICATION_MIDDLE@“ or “@TIMEOUT_NOTIFICATION_LONG@“, then GRUB will update this property with an informative message as the timeout approaches.</td></tr> </tbody> </table> </li><li>circular_progress Displays a circular progress indicator. The appearance of this component is determined by two images: the *center* image and the *tick* image. The center image is generally larger and will be drawn in the center of the component. Around the circumference of a circle within the component, the tick image will be drawn a certain number of times, depending on the properties of the component. <p>Properties: </p> <table class="multitable"> <tbody><tr><td width="30%">id</td><td width="60%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="30%">center_bitmap</td><td width="60%">The file name of the image to draw in the center of the component.</td></tr> <tr><td width="30%">tick_bitmap</td><td width="60%">The file name of the image to draw for the tick marks.</td></tr> <tr><td width="30%">num_ticks</td><td width="60%">The number of ticks that make up a full circle.</td></tr> <tr><td width="30%">ticks_disappear</td><td width="60%">Boolean value indicating whether tick marks should progressively appear, or progressively disappear as *value* approaches *end*. Specify “true“ or “false“. Default is “false“.</td></tr> <tr><td width="30%">start_angle</td><td width="60%">The position of the first tick mark to appear or disappear. Measured in "parrots", 1 "parrot" = 1 / 256 of the full circle. Use values “xxx deg“ or “xxx \xc2\xb0“ to set the angle in degrees.</td></tr> </tbody> </table> </li><li>boot_menu Displays the GRUB boot menu. It allows selecting items and executing them. <p>Properties: </p> <table class="multitable"> <tbody><tr><td width="40%">item_font</td><td width="50%">The font to use for the menu item titles.</td></tr> <tr><td width="40%">selected_item_font</td><td width="50%">The font to use for the selected menu item, or “inherit“ (the default) to use “item_font“ for the selected menu item as well.</td></tr> <tr><td width="40%">item_color</td><td width="50%">The color to use for the menu item titles.</td></tr> <tr><td width="40%">selected_item_color</td><td width="50%">The color to use for the selected menu item, or “inherit“ (the default) to use “item_color“ for the selected menu item as well.</td></tr> <tr><td width="40%">icon_width</td><td width="50%">The width of menu item icons. Icons are scaled to the specified size.</td></tr> <tr><td width="40%">icon_height</td><td width="50%">The height of menu item icons.</td></tr> <tr><td width="40%">item_height</td><td width="50%">The height of each menu item in pixels.</td></tr> <tr><td width="40%">item_padding</td><td width="50%">The amount of space in pixels to leave on each side of the menu item contents.</td></tr> <tr><td width="40%">item_icon_space</td><td width="50%">The space between an item’s icon and the title text, in pixels.</td></tr> <tr><td width="40%">item_spacing</td><td width="50%">The amount of space to leave between menu items, in pixels.</td></tr> <tr><td width="40%">menu_pixmap_style</td><td width="50%">The image file pattern for the menu frame styled box. Example: “menu_*.png“ (this will use images such as “menu_c.png“, “menu_w.png“, ‘menu_nw.png“, etc.)</td></tr> <tr><td width="40%">item_pixmap_style</td><td width="50%">The image file pattern for the item styled box.</td></tr> <tr><td width="40%">selected_item_pixmap_style</td><td width="50%">The image file pattern for the selected item highlight styled box.</td></tr> <tr><td width="40%">scrollbar</td><td width="50%">Boolean value indicating whether the scroll bar should be drawn if the frame and thumb styled boxes are configured.</td></tr> <tr><td width="40%">scrollbar_frame</td><td width="50%">The image file pattern for the entire scroll bar. Example: “scrollbar_*.png“</td></tr> <tr><td width="40%">scrollbar_thumb</td><td width="50%">The image file pattern for the scroll bar thumb (the part of the scroll bar that moves as scrolling occurs). Example: “scrollbar_thumb_*.png“</td></tr> <tr><td width="40%">scrollbar_thumb_overlay</td><td width="50%">If this option is set to “true“ then the scrollbar thumb side slices (every slice except the center slice) will overlay the scrollbar frame side slices. And the center slice of the scrollbar_thumb can move all the way (from top to bottom), being drawn on the center slice of the scrollbar frame. That way we can make a scrollbar with round-shaped edges so there won’t be a free space from the thumb to the frame in top and bottom scrollbar positions. Default is “false“.</td></tr> <tr><td width="40%">scrollbar_slice</td><td width="50%">The menu frame styled box’s slice in which the scrollbar will be drawn. Possible values are “west“, “center“, “east“ (default). “west“ - the scrollbar will be drawn in the west slice (right-aligned). “east“ - the scrollbar will be drawn in the east slice (left-aligned). “center“ - the scrollbar will be drawn in the center slice. Note: in case of “center“ slice: a) If the scrollbar should be drawn then boot menu entry’s width is decreased by the scrollbar’s width and the scrollbar is drawn at the right side of the center slice. b) If the scrollbar won’t be drawn then the boot menu entry’s width is the width of the center slice. c) We don’t necessary need the menu pixmap box to display the scrollbar.</td></tr> <tr><td width="40%">scrollbar_left_pad</td><td width="50%">The left scrollbar padding in pixels. Unused if “scrollbar_slice“ is “west“.</td></tr> <tr><td width="40%">scrollbar_right_pad</td><td width="50%">The right scrollbar padding in pixels. Unused if “scrollbar_slice“ is “east“.</td></tr> <tr><td width="40%">scrollbar_top_pad</td><td width="50%">The top scrollbar padding in pixels.</td></tr> <tr><td width="40%">scrollbar_bottom_pad</td><td width="50%">The bottom scrollbar padding in pixels.</td></tr> <tr><td width="40%">visible</td><td width="50%">Set to “false“ to hide the boot menu.</td></tr> </tbody> </table> </li><li>canvas Canvas is a container that allows manual placement of components within it. It does not alter the positions of its child components. It assigns all child components their preferred sizes. </li><li>hbox The *hbox* container lays out its children from left to right, giving each one its preferred width. The height of each child is set to the maximum of the preferred heights of all children. </li><li>vbox The *vbox* container lays out its children from top to bottom, giving each one its preferred height. The width of each child is set to the maximum of the preferred widths of all children. </li></ul> </div> <div class="subsection-level-extent" id="Common-properties"> <h4 class="subsection"><span>7.3.6 Common properties<a class="copiable-link" href="#Common-properties"> ¶</a></span></h4> <p>The following properties are supported by all components: </p><dl class="table"> <dt>‘<samp class="samp">left</samp>’</dt> <dd><p>The distance from the left border of container to left border of the object in either of three formats: </p><table class="multitable"> <tbody><tr><td width="20%">x</td><td width="70%">Value in pixels</td></tr> <tr><td width="20%">p%</td><td width="70%">Percentage</td></tr> <tr><td width="20%">p%+x</td><td width="70%">mixture of both</td></tr> </tbody> </table> </dd> <dt>‘<samp class="samp">top</samp>’</dt> <dd><p>The distance from the left border of container to left border of the object in same format. </p></dd> <dt>‘<samp class="samp">width</samp>’</dt> <dd><p>The width of object in same format. </p></dd> <dt>‘<samp class="samp">height</samp>’</dt> <dd><p>The height of object in same format. </p></dd> <dt>‘<samp class="samp">id</samp>’</dt> <dd><p>The identifier for the component. This can be any arbitrary string. The ID can be used by scripts to refer to various components in the GUI component tree. Currently, there is one special ID value that GRUB recognizes: </p> <table class="multitable"> <tbody><tr><td width="20%">“__timeout__“</td><td width="70%">Component with this ID will be updated by GRUB and will indicate time elapsed to an automatical boot of the default entry. Affected components: “label“, “circular_progress“, “progress_bar“.</td></tr> </tbody> </table> </dd> </dl> <hr> </div> </div> </div> <div class="chapter-level-extent" id="Network"> <div class="nav-panel"> <p> Next: <a href="#Serial-terminal" accesskey="n" rel="next">Using GRUB via a serial line</a>, Previous: <a href="#Theme-file-format" accesskey="p" rel="prev">Theme file format</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Booting-GRUB-from-the-network"><span>8 Booting GRUB from the network<a class="copiable-link" href="#Booting-GRUB-from-the-network"> ¶</a></span></h2> <p>The following instructions don’t work for *-emu, i386-qemu, i386-coreboot, i386-multiboot, mips_loongson, mips-arc and mips_qemu_mips </p> <p>To generate a netbootable directory, run: </p> <div class="example"> <div class="group"><pre class="example-preformatted">grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/<platform> </pre></div></div> <p>E.g. for i386-pc: </p> <div class="example"> <div class="group"><pre class="example-preformatted">grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc </pre></div></div> <p>Then follow instructions printed out by grub2-mknetdir on configuring your DHCP server. </p> <p>The grub.cfg file is placed in the same directory as the path output by grub-mknetdir hereafter referred to as FWPATH. GRUB will search for its configuration files in order using the following rules where the appended value corresponds to a value on the client machine. </p> <div class="example"> <div class="group"><pre class="example-preformatted">‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-‘<samp class="samp">(UUID OF MACHINE)</samp>’ ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-‘<samp class="samp">(MAC ADDRESS OF NIC)</samp>’ ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-‘<samp class="samp">(IPv4 OR IPv6 ADDRESS)</samp>’ ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg </pre></div></div> <p>The UUID is the Client Machine Identifier Option Definition as specified in RFC 4578. The client will only attempt to loouk up a UUID config file if it was provided by the DHCP server. </p> <p>The client will only attempt to look up an IPv6 address config once, however, it will try the IPv4 multiple times. The concrete example below shows what would happen under the IPv4 case. </p> <div class="example"> <div class="group"><pre class="example-preformatted">UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a MAC: 52:54:00:ec:33:81 IPV4: 10.0.0.130 (0A000082) </pre></div></div> <div class="example"> <div class="group"><pre class="example-preformatted">‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-52-54-00-ec-33-81 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A000082 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A00008 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A0000 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A000 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A00 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A0 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0A ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg-0 ‘<samp class="samp">(FWPATH)</samp>’/grub.cfg </pre></div></div> <p>This feature is enabled by default but it can be disabled by setting the ‘<samp class="samp">feature_net_search_cfg</samp>’ to ‘<samp class="samp">n</samp>’. Since this happens before the configuration file is read by GRUB, this option has to be disabled in an embedded configuration file (see <a class="pxref" href="#Embedded-configuration">Embedding a configuration file into GRUB</a>). </p> <p>After GRUB has started, files on the TFTP server will be accessible via the ‘<samp class="samp">(tftp)</samp>’ device. </p> <p>The server IP address can be controlled by changing the ‘<samp class="samp">(tftp)</samp>’ device name to ‘<samp class="samp">(tftp,<var class="var">server-ip</var>)</samp>’. Note that this should be changed both in the prefix and in any references to the device name in the configuration file. </p> <p>GRUB provides several environment variables which may be used to inspect or change the behaviour of the PXE device. In the following description <var class="var"><interface></var> is placeholder for the name of network interface (platform dependent): </p> <dl class="table"> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_ip</samp>’</dt> <dd><p>The network interface’s IP address. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_mac</samp>’</dt> <dd><p>The network interface’s MAC address. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_clientid</samp>’</dt> <dd><p>The client id provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_clientuuid</samp>’</dt> <dd><p>The client uuid provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_hostname</samp>’</dt> <dd><p>The client host name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_domain</samp>’</dt> <dd><p>The client domain name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_rootpath</samp>’</dt> <dd><p>The path to the client’s root disk provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_extensionspath</samp>’</dt> <dd><p>The path to additional DHCP vendor extensions provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_boot_file</samp>’</dt> <dd><p>The boot file name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_dhcp_server_name</samp>’</dt> <dd><p>The name of the DHCP server responsible for these boot parameters. Read-only. </p> </dd> <dt>‘<samp class="samp">net_<var class="var"><interface></var>_next_server</samp>’</dt> <dd><p>The IP address of the next (usually, TFTP) server provided by DHCP. Read-only. </p> </dd> <dt>‘<samp class="samp">net_default_interface</samp>’</dt> <dd><p>Initially set to name of network interface that was used to load grub. Read-write, although setting it affects only interpretation of ‘<samp class="samp">net_default_ip</samp>’ and ‘<samp class="samp">net_default_mac</samp>’ </p> </dd> <dt>‘<samp class="samp">net_default_ip</samp>’</dt> <dd><p>The IP address of default interface. Read-only. This is alias for the ‘<samp class="samp">net_${net_default_interface}_ip</samp>’. </p> </dd> <dt>‘<samp class="samp">net_default_mac</samp>’</dt> <dd><p>The default interface’s MAC address. Read-only. This is alias for the ‘<samp class="samp">net_${net_default_interface}_mac</samp>’. </p> </dd> <dt>‘<samp class="samp">net_default_server</samp>’</dt> <dd><p>The default server used by network drives (see <a class="pxref" href="#Device-syntax">How to specify devices</a>). Read-write, although setting this is only useful before opening a network device. </p> </dd> </dl> <hr> </div> <div class="chapter-level-extent" id="Serial-terminal"> <div class="nav-panel"> <p> Next: <a href="#Vendor-power_002don-keys" accesskey="n" rel="next">Using GRUB with vendor power-on keys</a>, Previous: <a href="#Network" accesskey="p" rel="prev">Booting GRUB from the network</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Using-GRUB-via-a-serial-line"><span>9 Using GRUB via a serial line<a class="copiable-link" href="#Using-GRUB-via-a-serial-line"> ¶</a></span></h2> <p>This chapter describes how to use the serial terminal support in GRUB. </p> <p>If you have many computers or computers with no display/keyboard, it could be very useful to control the computers through serial communications. To connect one computer with another via a serial line, you need to prepare a null-modem (cross) serial cable, and you may need to have multiport serial boards, if your computer doesn’t have extra serial ports. In addition, a terminal emulator is also required, such as minicom. Refer to a manual of your operating system, for more information. </p> <p>As for GRUB, the instruction to set up a serial terminal is quite simple. Here is an example: </p> <div class="example"> <div class="group"><pre class="example-preformatted">grub> <kbd class="kbd">serial --unit=0 --speed=9600</kbd> grub> <kbd class="kbd">terminal_input serial; terminal_output serial</kbd> </pre></div></div> <p>The command <code class="command">serial</code> initializes the serial unit 0 with the speed 9600bps. The serial unit 0 is usually called ‘<samp class="samp">COM1</samp>’, so, if you want to use COM2, you must specify ‘<samp class="samp">--unit=1</samp>’ instead. This command accepts many other options, see <a class="pxref" href="#serial">serial</a> for more details. </p> <p>Without argument or with ‘<samp class="samp">--port=auto</samp>’, GRUB will attempt to use ACPI when available to auto-detect the default serial port and its configuration. </p> <p>The commands <code class="command">terminal_input</code> (see <a class="pxref" href="#terminal_005finput">terminal_input</a>) and <code class="command">terminal_output</code> (see <a class="pxref" href="#terminal_005foutput">terminal_output</a>) choose which type of terminal you want to use. In the case above, the terminal will be a serial terminal, but you can also pass <code class="code">console</code> to the command, as ‘<samp class="samp">terminal_input serial console</samp>’. In this case, a terminal in which you press any key will be selected as a GRUB terminal. In the example above, note that you need to put both commands on the same command line, as you will lose the ability to type commands on the console after the first command. </p> <p>However, note that GRUB assumes that your terminal emulator is compatible with VT100 by default. This is true for most terminal emulators nowadays, but you should pass the option <samp class="option">--dumb</samp> to the command if your terminal emulator is not VT100-compatible or implements few VT100 escape sequences. If you specify this option then GRUB provides you with an alternative menu interface, because the normal menu requires several fancy features of your terminal. </p> <hr> </div> <div class="chapter-level-extent" id="Vendor-power_002don-keys"> <div class="nav-panel"> <p> Next: <a href="#Images" accesskey="n" rel="next">GRUB image files</a>, Previous: <a href="#Serial-terminal" accesskey="p" rel="prev">Using GRUB via a serial line</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Using-GRUB-with-vendor-power_002don-keys"><span>10 Using GRUB with vendor power-on keys<a class="copiable-link" href="#Using-GRUB-with-vendor-power_002don-keys"> ¶</a></span></h2> <p>Some laptop vendors provide an additional power-on button which boots another OS. GRUB supports such buttons with the ‘<samp class="samp">GRUB_TIMEOUT_BUTTON</samp>’, ‘<samp class="samp">GRUB_TIMEOUT_STYLE_BUTTON</samp>’, ‘<samp class="samp">GRUB_DEFAULT_BUTTON</samp>’, and ‘<samp class="samp">GRUB_BUTTON_CMOS_ADDRESS</samp>’ variables in default/grub (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). ‘<samp class="samp">GRUB_TIMEOUT_BUTTON</samp>’, ‘<samp class="samp">GRUB_TIMEOUT_STYLE_BUTTON</samp>’, and ‘<samp class="samp">GRUB_DEFAULT_BUTTON</samp>’ are used instead of the corresponding variables without the ‘<samp class="samp">_BUTTON</samp>’ suffix when powered on using the special button. ‘<samp class="samp">GRUB_BUTTON_CMOS_ADDRESS</samp>’ is vendor-specific and partially model-specific. Values known to the GRUB team are: </p> <dl class="table"> <dt><kbd class="key">Dell XPS M1330M</kbd></dt> <dd><p>121:3 </p></dd> <dt><kbd class="key">Dell XPS M1530</kbd></dt> <dd><p>85:3 </p></dd> <dt><kbd class="key">Dell Latitude E4300</kbd></dt> <dd><p>85:3 </p></dd> <dt><kbd class="key">Asus EeePC 1005PE</kbd></dt> <dd><p>84:1 (unconfirmed) </p></dd> <dt><kbd class="key">LENOVO ThinkPad T410s (2912W1C)</kbd></dt> <dd><p>101:3 </p></dd> </dl> <p>To take full advantage of this function, install GRUB into the MBR (see <a class="pxref" href="#Installing-GRUB-using-grub2_002dinstall">Installing GRUB using grub2-install</a>). </p> <p>If you have a laptop which has a similar feature and not in the above list could you figure your address and contribute? To discover the address do the following: </p><ul class="itemize mark-bullet"> <li>boot normally </li><li><div class="example"> <pre class="example-preformatted">sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_button.txt </pre></div> </li><li>boot using vendor button </li><li><div class="example"> <pre class="example-preformatted">sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_vendor.txt </pre></div> </li></ul> <p>Then compare these text files and find where a bit was toggled. E.g. in case of Dell XPS it was: </p><div class="example"> <pre class="example-preformatted">byte 0x47: 20 --> 28 </pre></div> <p>It’s a bit number 3 as seen from following table: </p><table class="multitable"> <tbody><tr><td width="20%">0</td><td width="20%">01</td></tr> <tr><td width="20%">1</td><td width="20%">02</td></tr> <tr><td width="20%">2</td><td width="20%">04</td></tr> <tr><td width="20%">3</td><td width="20%">08</td></tr> <tr><td width="20%">4</td><td width="20%">10</td></tr> <tr><td width="20%">5</td><td width="20%">20</td></tr> <tr><td width="20%">6</td><td width="20%">40</td></tr> <tr><td width="20%">7</td><td width="20%">80</td></tr> </tbody> </table> <p>0x47 is decimal 71. Linux nvram implementation cuts first 14 bytes of CMOS. So the real byte address in CMOS is 71+14=85 So complete address is 85:3 </p> <hr> </div> <div class="chapter-level-extent" id="Images"> <div class="nav-panel"> <p> Next: <a href="#Core-image-size-limitation" accesskey="n" rel="next">Core image size limitation</a>, Previous: <a href="#Vendor-power_002don-keys" accesskey="p" rel="prev">Using GRUB with vendor power-on keys</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="GRUB-image-files"><span>11 GRUB image files<a class="copiable-link" href="#GRUB-image-files"> ¶</a></span></h2> <p>GRUB consists of several images: a variety of bootstrap images for starting GRUB in various ways, a kernel image, and a set of modules which are combined with the kernel image to form a core image. Here is a short overview of them. </p> <dl class="table"> <dt><samp class="file">boot.img</samp></dt> <dd><p>On PC BIOS systems, this image is the first part of GRUB to start. It is written to a master boot record (MBR) or to the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. </p> <p>The sole function of <samp class="file">boot.img</samp> is to read the first sector of the core image from a local disk and jump to it. Because of the size restriction, <samp class="file">boot.img</samp> cannot understand any file system structure, so <code class="command">grub2-install</code> hardcodes the location of the first sector of the core image into <samp class="file">boot.img</samp> when installing GRUB. </p> </dd> <dt><samp class="file">diskboot.img</samp></dt> <dd><p>This image is used as the first sector of the core image when booting from a hard disk. It reads the rest of the core image into memory and starts the kernel. Since file system handling is not yet available, it encodes the location of the core image using a block list format. </p> </dd> <dt><samp class="file">cdboot.img</samp></dt> <dd><p>This image is used as the first sector of the core image when booting from a CD-ROM drive. It performs a similar function to <samp class="file">diskboot.img</samp>. </p> </dd> <dt><samp class="file">pxeboot.img</samp></dt> <dd><p>This image is used as the start of the core image when booting from the network using PXE. See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> </dd> <dt><samp class="file">lnxboot.img</samp></dt> <dd><p>This image may be placed at the start of the core image in order to make GRUB look enough like a Linux kernel that it can be booted by LILO using an ‘<samp class="samp">image=</samp>’ section. </p> </dd> <dt><samp class="file">kernel.img</samp></dt> <dd><p>This image contains GRUB’s basic run-time facilities: frameworks for device and file handling, environment variables, the rescue mode command-line parser, and so on. It is rarely used directly, but is built into all core images. </p> </dd> <dt><samp class="file">core.img</samp></dt> <dd><p>This is the core image of GRUB. It is built dynamically from the kernel image and an arbitrary list of modules by the <code class="command">grub2-mkimage</code> program. Usually, it contains enough modules to access <samp class="file">/boot/grub</samp>, and loads everything else (including menu handling, the ability to load target operating systems, and so on) from the file system at run-time. The modular design allows the core image to be kept small, since the areas of disk where it must be installed are often as small as 32KB. </p> <p>See <a class="xref" href="#BIOS-installation">BIOS installation</a>, for details on where the core image can be installed on PC systems. </p> </dd> <dt><samp class="file">*.mod</samp></dt> <dd><p>Everything else in GRUB resides in dynamically loadable modules. These are often loaded automatically, or built into the core image if they are essential, but may also be loaded manually using the <code class="command">insmod</code> command (see <a class="pxref" href="#insmod">insmod</a>). </p></dd> </dl> <h3 class="heading" id="For-GRUB-Legacy-users"><span>For GRUB Legacy users<a class="copiable-link" href="#For-GRUB-Legacy-users"> ¶</a></span></h3> <p>GRUB 2 has a different design from GRUB Legacy, and so correspondences with the images it used cannot be exact. Nevertheless, GRUB Legacy users often ask questions in the terms they are familiar with, and so here is a brief guide to how GRUB 2’s images relate to that. </p> <dl class="table"> <dt><samp class="file">stage1</samp></dt> <dd><p>Stage 1 from GRUB Legacy was very similar to <samp class="file">boot.img</samp> in GRUB 2, and they serve the same function. </p> </dd> <dt><samp class="file">*_stage1_5</samp></dt> <dd><p>In GRUB Legacy, Stage 1.5’s function was to include enough filesystem code to allow the much larger Stage 2 to be read from an ordinary filesystem. In this respect, its function was similar to <samp class="file">core.img</samp> in GRUB 2. However, <samp class="file">core.img</samp> is much more capable than Stage 1.5 was; since it offers a rescue shell, it is sometimes possible to recover manually in the event that it is unable to load any other modules, for example if partition numbers have changed. <samp class="file">core.img</samp> is built in a more flexible way, allowing GRUB 2 to support reading modules from advanced disk types such as LVM and RAID. </p> <p>GRUB Legacy could run with only Stage 1 and Stage 2 in some limited configurations, while GRUB 2 requires <samp class="file">core.img</samp> and cannot work without it. </p> </dd> <dt><samp class="file">stage2</samp></dt> <dd><p>GRUB 2 has no single Stage 2 image. Instead, it loads modules from <samp class="file">/boot/grub</samp> at run-time. </p> </dd> <dt><samp class="file">stage2_eltorito</samp></dt> <dd><p>In GRUB 2, images for booting from CD-ROM drives are now constructed using <samp class="file">cdboot.img</samp> and <samp class="file">core.img</samp>, making sure that the core image contains the ‘<samp class="samp">iso9660</samp>’ module. It is usually best to use the <code class="command">grub2-mkrescue</code> program for this. </p> </dd> <dt><samp class="file">nbgrub</samp></dt> <dd><p>There is as yet no equivalent for <samp class="file">nbgrub</samp> in GRUB 2; it was used by Etherboot and some other network boot loaders. </p> </dd> <dt><samp class="file">pxegrub</samp></dt> <dd><p>In GRUB 2, images for PXE network booting are now constructed using <samp class="file">pxeboot.img</samp> and <samp class="file">core.img</samp>, making sure that the core image contains the ‘<samp class="samp">pxe</samp>’ and ‘<samp class="samp">pxecmd</samp>’ modules. See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p></dd> </dl> <hr> </div> <div class="chapter-level-extent" id="Core-image-size-limitation"> <div class="nav-panel"> <p> Next: <a href="#Filesystem" accesskey="n" rel="next">Filesystem syntax and semantics</a>, Previous: <a href="#Images" accesskey="p" rel="prev">GRUB image files</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Core-image-size-limitation-1"><span>12 Core image size limitation<a class="copiable-link" href="#Core-image-size-limitation-1"> ¶</a></span></h2> <p>Heavily limited platforms: </p><ul class="itemize mark-bullet"> <li>i386-pc (normal and PXE): the core image size (compressed) is limited by 458240 bytes. kernel.img (.text + .data + .bss, uncompressed) is limited by 392704 bytes. module size (uncompressed) + kernel.img (.text + .data, uncompressed) is limited by the size of contiguous chunk at 1M address. </li><li>sparc64-ieee1275: kernel.img (.text + .data + .bss) + modules + 256K (stack) + 2M (heap) is limited by space available at 0x4400. On most platforms it’s just 3 or 4M since ieee1275 maps only so much. </li><li>i386-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by memory available at 0x10000, at most 596K </li></ul> <p>Lightly limited platforms: </p> <ul class="itemize mark-bullet"> <li>*-xen: limited only by adress space and RAM size. </li><li>i386-qemu: kernel.img (.text + .data + .bss) is limited by 392704 bytes. (core.img would be limited by ROM size but it’s unlimited on qemu </li><li>All EFI platforms: limited by contiguous RAM size and possibly firmware bugs </li><li>Coreboot and multiboot. kernel.img (.text + .data + .bss) is limited by 392704 bytes. module size is limited by the size of contiguous chunk at 1M address. </li><li>mipsel-loongson (ELF), mips(el)-qemu_mips (ELF): if uncompressed: kernel.img (.text + .data) + modules is limited by the space from 80200000 forward if compressed: kernel.img (.text + .data, uncompressed) + modules (uncompressed) + (modules + kernel.img (.text + .data)) (compressed) + decompressor is limited by the space from 80200000 forward </li><li>mipsel-loongson (Flash), mips(el)-qemu_mips (Flash): kernel.img (.text + .data) + modules is limited by the space from 80200000 forward core.img (final) is limited by flash size (512K on yeeloong and fulooong) </li><li>mips-arc: if uncompressed: kernel.img (.text + .data) is limited by the space from 8bd00000 forward modules + dummy decompressor is limited by the space from 8bd00000 backward if compressed: kernel.img (.text + .data, uncompressed) is limited by the space from 8bd00000 forward modules (uncompressed) + (modules + kernel.img (.text + .data)) (compressed, aligned to 1M) + 1M (decompressor + scratch space) is limited by the space from 8bd00000 backward </li><li>powerpc-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by space available at 0x200000 </li></ul> <hr> </div> <div class="chapter-level-extent" id="Filesystem"> <div class="nav-panel"> <p> Next: <a href="#Interface" accesskey="n" rel="next">GRUB’s user interface</a>, Previous: <a href="#Core-image-size-limitation" accesskey="p" rel="prev">Core image size limitation</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Filesystem-syntax-and-semantics"><span>13 Filesystem syntax and semantics<a class="copiable-link" href="#Filesystem-syntax-and-semantics"> ¶</a></span></h2> <p>GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command <code class="command">search</code> (see <a class="pxref" href="#search">search</a>). </p> <ul class="mini-toc"> <li><a href="#Device-syntax" accesskey="1">How to specify devices</a></li> <li><a href="#File-name-syntax" accesskey="2">How to specify files</a></li> <li><a href="#Block-list-syntax" accesskey="3">How to specify block lists</a></li> </ul> <hr> <div class="section-level-extent" id="Device-syntax"> <div class="nav-panel"> <p> Next: <a href="#File-name-syntax" accesskey="n" rel="next">How to specify files</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem syntax and semantics</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="How-to-specify-devices"><span>13.1 How to specify devices<a class="copiable-link" href="#How-to-specify-devices"> ¶</a></span></h3> <p>The device syntax is like this: </p> <div class="example"> <pre class="example-preformatted"><code class="code">(<var class="var">device</var>[,<var class="var">partmap-name1</var><var class="var">part-num1</var>[,<var class="var">partmap-name2</var><var class="var">part-num2</var>[,...]]])</code> </pre></div> <p>‘<samp class="samp">[]</samp>’ means the parameter is optional. <var class="var">device</var> depends on the disk driver in use. BIOS and EFI disks use either ‘<samp class="samp">fd</samp>’ or ‘<samp class="samp">hd</samp>’ followed by a digit, like ‘<samp class="samp">fd0</samp>’, or ‘<samp class="samp">cd</samp>’. AHCI, PATA (ata), crypto, USB use the name of driver followed by a number. Memdisk and host are limited to one disk and so it’s refered just by driver name. RAID (md), ofdisk (ieee1275 and nand), LVM (lvm), LDM, virtio (vdsk) and arcdisk (arc) use intrinsic name of disk prefixed by driver name. Additionally just “nand” refers to the disk aliased as “nand”. Conflicts are solved by suffixing a number if necessarry. Commas need to be escaped. Loopback uses whatever name specified to <code class="command">loopback</code> command. Hostdisk uses names specified in device.map as long as it’s of the form [fhc]d[0-9]* or hostdisk/<OS DEVICE>. For crypto and RAID (md) additionally you can use the syntax <driver name>uuid/<uuid>. For LVM additionally you can use the syntax lvmid/<volume-group-uuid>/<volume-uuid>. </p> <div class="example"> <pre class="example-preformatted">(fd0) (hd0) (cd) (ahci0) (ata0) (crypto0) (usb0) (cryptouuid/123456789abcdef0123456789abcdef0) (mduuid/123456789abcdef0123456789abcdef0) (lvm/system-root) (lvmid/F1ikgD-2RES-306G-il9M-7iwa-4NKW-EbV1NV/eLGuCQ-L4Ka-XUgR-sjtJ-ffch-bajr-fCNfz5) (md/myraid) (md/0) (ieee1275/disk2) (ieee1275//pci@1f\,0/ide@d/disk@2) (nand) (memdisk) (host) (myloop) (hostdisk//dev/sda) </pre></div> <p><var class="var">part-num</var> represents the partition number of <var class="var">device</var>, starting from one. <var class="var">partname</var> is optional but is recommended since disk may have several top-level partmaps. Specifying third and later component you can access to subpartitions. </p> <p>The syntax ‘<samp class="samp">(hd0)</samp>’ represents using the entire disk (or the MBR when installing GRUB), while the syntax ‘<samp class="samp">(hd0,1)</samp>’ represents using the first partition of the disk (or the boot sector of the partition when installing GRUB). </p> <div class="example"> <pre class="example-preformatted">(hd0,msdos1) (hd0,msdos1,msdos5) (hd0,msdos1,bsd3) (hd0,netbsd1) (hd0,gpt1) (hd0,1,3) </pre></div> <p>If you enabled the network support, the special drives <code class="code">(<var class="var">protocol</var>[,<var class="var">server</var>])</code> are also available. Supported protocols are ‘<samp class="samp">http</samp>’ and ‘<samp class="samp">tftp</samp>’. If <var class="var">server</var> is omitted, value of environment variable ‘<samp class="samp">net_default_server</samp>’ is used. Before using the network drive, you must initialize the network. See <a class="xref" href="#Network">Booting GRUB from the network</a>, for more information. </p> <p>When using ‘<samp class="samp">http</samp>’ or ‘<samp class="samp">tftp</samp>’, ports other than ‘<samp class="samp">80</samp>’ can be specified using a colon (‘<samp class="samp">:</samp>’) after the address. To avoid parsing conflicts, when using IPv6 addresses with custom ports, the addresses must be enclosed with square brackets (‘<samp class="samp">[]</samp>’), as is standard practice. </p> <div class="example"> <pre class="example-preformatted">(http,grub.example.com:31337) (http,192.0.2.1:339) (http,[2001:db8::1]:11235) </pre></div> <p>If you boot GRUB from a CD-ROM, ‘<samp class="samp">(cd)</samp>’ is available. See <a class="xref" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, for details. </p> <hr> </div> <div class="section-level-extent" id="File-name-syntax"> <div class="nav-panel"> <p> Next: <a href="#Block-list-syntax" accesskey="n" rel="next">How to specify block lists</a>, Previous: <a href="#Device-syntax" accesskey="p" rel="prev">How to specify devices</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem syntax and semantics</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="How-to-specify-files"><span>13.2 How to specify files<a class="copiable-link" href="#How-to-specify-files"> ¶</a></span></h3> <p>There are two ways to specify files, by <em class="dfn">absolute file name</em> and by <em class="dfn">block list</em>. </p> <p>An absolute file name resembles a Unix absolute file name, using ‘<samp class="samp">/</samp>’ for the directory separator (not ‘<samp class="samp">\</samp>’ as in DOS). One example is ‘<samp class="samp">(hd0,1)/boot/grub2/grub.cfg</samp>’. This means the file <samp class="file">/boot/grub2/grub.cfg</samp> in the first partition of the first hard disk. If you omit the device name in an absolute file name, GRUB uses GRUB’s <em class="dfn">root device</em> implicitly. So if you set the root device to, say, ‘<samp class="samp">(hd1,1)</samp>’ by the command ‘<samp class="samp">set root=(hd1,1)</samp>’ (see <a class="pxref" href="#set">set</a>), then <code class="code">/boot/kernel</code> is the same as <code class="code">(hd1,1)/boot/kernel</code>. </p> <p>On ZFS filesystem the first path component must be <var class="var">volume</var>‘<samp class="samp">@</samp>’[<var class="var">snapshot</var>]. So ‘<samp class="samp">/rootvol@snap-129/boot/grub2/grub.cfg</samp>’ refers to file ‘<samp class="samp">/boot/grub2/grub.cfg</samp>’ in snapshot of volume ‘<samp class="samp">rootvol</samp>’ with name ‘<samp class="samp">snap-129</samp>’. Trailing ‘<samp class="samp">@</samp>’ after volume name is mandatory even if snapshot name is omitted. </p> <hr> </div> <div class="section-level-extent" id="Block-list-syntax"> <div class="nav-panel"> <p> Previous: <a href="#File-name-syntax" accesskey="p" rel="prev">How to specify files</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem syntax and semantics</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="How-to-specify-block-lists"><span>13.3 How to specify block lists<a class="copiable-link" href="#How-to-specify-block-lists"> ¶</a></span></h3> <p>A block list is used for specifying a file that doesn’t appear in the filesystem, like a chainloader. The syntax is <code class="code">[<var class="var">offset</var>]+[<var class="var">length</var>][,[<var class="var">offset</var>]+[<var class="var">length</var>]]…</code>. Here is an example: </p> <div class="example"> <pre class="example-preformatted"><code class="code">0+100,200+1,300+300,800+</code> </pre></div> <p>This represents that GRUB should read blocks 0 through 99, block 200, blocks 300 through 599, and blocks 800 until the end of the device. If you omit an offset, then GRUB assumes the offset is zero. If the length is omitted, then GRUB assumes the block list extends until the end of the device. </p> <p>Like the file name syntax (see <a class="pxref" href="#File-name-syntax">How to specify files</a>), if a blocklist does not contain a device name, then GRUB uses GRUB’s <em class="dfn">root device</em>. So <code class="code">(hd0,2)+1</code> is the same as <code class="code">+1</code> when the root device is ‘<samp class="samp">(hd0,2)</samp>’. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Interface"> <div class="nav-panel"> <p> Next: <a href="#Environment" accesskey="n" rel="next">GRUB environment variables</a>, Previous: <a href="#Filesystem" accesskey="p" rel="prev">Filesystem syntax and semantics</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="GRUB_0027s-user-interface"><span>14 GRUB’s user interface<a class="copiable-link" href="#GRUB_0027s-user-interface"> ¶</a></span></h2> <p>GRUB has both a simple menu interface for choosing preset entries from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands. </p> <p>GRUB looks for its configuration file as soon as it is loaded. If one is found, then the full menu interface is activated using whatever entries were found in the file. If you choose the <em class="dfn">command-line</em> menu option, or if the configuration file was not found, then GRUB drops to the command-line interface. </p> <ul class="mini-toc"> <li><a href="#Command_002dline-interface" accesskey="1">The flexible command-line interface</a></li> <li><a href="#Menu-interface" accesskey="2">The simple menu interface</a></li> <li><a href="#Menu-entry-editor" accesskey="3">Editing a menu entry</a></li> </ul> <hr> <div class="section-level-extent" id="Command_002dline-interface"> <div class="nav-panel"> <p> Next: <a href="#Menu-interface" accesskey="n" rel="next">The simple menu interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">GRUB’s user interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="The-flexible-command_002dline-interface"><span>14.1 The flexible command-line interface<a class="copiable-link" href="#The-flexible-command_002dline-interface"> ¶</a></span></h3> <p>The command-line interface provides a prompt and after it an editable text area much like a command-line in Unix or DOS. Each command is immediately executed after it is entered<a class="footnote" id="DOCF8" href="#FOOT8"><sup>8</sup></a>. The commands (see <a class="pxref" href="#Commands">Available commands</a>) are a subset of those available in the configuration file, used with exactly the same syntax. </p> <p>Cursor movement and editing of the text on the line can be done via a subset of the functions available in the Bash shell: </p> <dl class="table"> <dt><kbd class="key">C-f</kbd></dt> <dt><kbd class="key">PC right key</kbd></dt> <dd><p>Move forward one character. </p> </dd> <dt><kbd class="key">C-b</kbd></dt> <dt><kbd class="key">PC left key</kbd></dt> <dd><p>Move back one character. </p> </dd> <dt><kbd class="key">C-a</kbd></dt> <dt><kbd class="key">HOME</kbd></dt> <dd><p>Move to the start of the line. </p> </dd> <dt><kbd class="key">C-e</kbd></dt> <dt><kbd class="key">END</kbd></dt> <dd><p>Move the the end of the line. </p> </dd> <dt><kbd class="key">C-d</kbd></dt> <dt><kbd class="key">DEL</kbd></dt> <dd><p>Delete the character underneath the cursor. </p> </dd> <dt><kbd class="key">C-h</kbd></dt> <dt><kbd class="key">BS</kbd></dt> <dd><p>Delete the character to the left of the cursor. </p> </dd> <dt><kbd class="key">C-k</kbd></dt> <dd><p>Kill the text from the current cursor position to the end of the line. </p> </dd> <dt><kbd class="key">C-u</kbd></dt> <dd><p>Kill backward from the cursor to the beginning of the line. </p> </dd> <dt><kbd class="key">C-y</kbd></dt> <dd><p>Yank the killed text back into the buffer at the cursor. </p> </dd> <dt><kbd class="key">C-p</kbd></dt> <dt><kbd class="key">PC up key</kbd></dt> <dd><p>Move up through the history list. </p> </dd> <dt><kbd class="key">C-n</kbd></dt> <dt><kbd class="key">PC down key</kbd></dt> <dd><p>Move down through the history list. </p></dd> </dl> <p>When typing commands interactively, if the cursor is within or before the first word in the command-line, pressing the <kbd class="key">TAB</kbd> key (or <kbd class="key">C-i</kbd>) will display a listing of the available commands, and if the cursor is after the first word, the <kbd class="kbd"><kbd class="key">TAB</kbd></kbd> will provide a completion listing of disks, partitions, and file names depending on the context. Note that to obtain a list of drives, one must open a parenthesis, as <code class="command">root (</code>. </p> <p>Note that you cannot use the completion functionality in the TFTP filesystem. This is because TFTP doesn’t support file name listing for the security. </p> <hr> </div> <div class="section-level-extent" id="Menu-interface"> <div class="nav-panel"> <p> Next: <a href="#Menu-entry-editor" accesskey="n" rel="next">Editing a menu entry</a>, Previous: <a href="#Command_002dline-interface" accesskey="p" rel="prev">The flexible command-line interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">GRUB’s user interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="The-simple-menu-interface"><span>14.2 The simple menu interface<a class="copiable-link" href="#The-simple-menu-interface"> ¶</a></span></h3> <p>The menu interface is quite easy to use. Its commands are both reasonably intuitive and described on screen. </p> <p>Basically, the menu interface provides a list of <em class="dfn">boot entries</em> to the user to choose from. Use the arrow keys to select the entry of choice, then press <kbd class="key">RET</kbd> to run it. An optional timeout is available to boot the default entry (the first one if not set), which is aborted by pressing any key. </p> <p>Commands are available to enter a bare command-line by pressing <kbd class="key">c</kbd> (which operates exactly like the non-config-file version of GRUB, but allows one to return to the menu if desired by pressing <kbd class="key">ESC</kbd>) or to edit any of the <em class="dfn">boot entries</em> by pressing <kbd class="key">e</kbd>. </p> <p>If you protect the menu interface with a password (see <a class="pxref" href="#Security">Security</a>), all you can do is choose an entry by pressing <kbd class="key">RET</kbd>, or press <kbd class="key">p</kbd> to enter the password. </p> <p>Pressing <kbd class="key">Ctrl-l</kbd> will refresh the menu, which can be useful when connecting via serial after the menu has been drawn. </p> <hr> </div> <div class="section-level-extent" id="Menu-entry-editor"> <div class="nav-panel"> <p> Previous: <a href="#Menu-interface" accesskey="p" rel="prev">The simple menu interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">GRUB’s user interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Editing-a-menu-entry"><span>14.3 Editing a menu entry<a class="copiable-link" href="#Editing-a-menu-entry"> ¶</a></span></h3> <p>The menu entry editor looks much like the main menu interface, but the lines in the menu are individual commands in the selected entry instead of entry names. </p> <p>If an <kbd class="key">ESC</kbd> is pressed in the editor, it aborts all the changes made to the configuration entry and returns to the main menu interface. </p> <p>Each line in the menu entry can be edited freely, and you can add new lines by pressing <kbd class="key">RET</kbd> at the end of a line. To boot the edited entry, press <kbd class="key">Ctrl-x</kbd>. </p> <p>Although GRUB unfortunately does not support <em class="dfn">undo</em>, you can do almost the same thing by just returning to the main menu using <kbd class="key">ESC</kbd>. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Environment"> <div class="nav-panel"> <p> Next: <a href="#Modules" accesskey="n" rel="next">Modules</a>, Previous: <a href="#Interface" accesskey="p" rel="prev">GRUB’s user interface</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="GRUB-environment-variables"><span>15 GRUB environment variables<a class="copiable-link" href="#GRUB-environment-variables"> ¶</a></span></h2> <p>GRUB supports environment variables which are rather like those offered by all Unix-like systems. Environment variables have a name, which is unique and is usually a short identifier, and a value, which is an arbitrary string of characters. They may be set (see <a class="pxref" href="#set">set</a>), unset (see <a class="pxref" href="#unset">unset</a>), or looked up (see <a class="pxref" href="#Shell_002dlike-scripting">Writing full configuration files directly</a>) by name. </p> <p>A number of environment variables have special meanings to various parts of GRUB. Others may be used freely in GRUB configuration files. </p> <ul class="mini-toc"> <li><a href="#Special-environment-variables" accesskey="1">Special environment variables</a></li> <li><a href="#Environment-block" accesskey="2">The GRUB environment block</a></li> </ul> <hr> <div class="section-level-extent" id="Special-environment-variables"> <div class="nav-panel"> <p> Next: <a href="#Environment-block" accesskey="n" rel="next">The GRUB environment block</a>, Up: <a href="#Environment" accesskey="u" rel="up">GRUB environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Special-environment-variables-1"><span>15.1 Special environment variables<a class="copiable-link" href="#Special-environment-variables-1"> ¶</a></span></h3> <p>These variables have special meaning to GRUB. </p> <ul class="mini-toc"> <li><a href="#biosnum" accesskey="1">biosnum</a></li> <li><a href="#check_005fappended_005fsignatures" accesskey="2">check_appended_signatures</a></li> <li><a href="#check_005fsignatures" accesskey="3">check_signatures</a></li> <li><a href="#chosen" accesskey="4">chosen</a></li> <li><a href="#cmdpath" accesskey="5">cmdpath</a></li> <li><a href="#color_005fhighlight" accesskey="6">color_highlight</a></li> <li><a href="#color_005fnormal" accesskey="7">color_normal</a></li> <li><a href="#config_005fdirectory" accesskey="8">config_directory</a></li> <li><a href="#config_005ffile" accesskey="9">config_file</a></li> <li><a href="#debug">debug</a></li> <li><a href="#default">default</a></li> <li><a href="#fallback">fallback</a></li> <li><a href="#gfxmode">gfxmode</a></li> <li><a href="#gfxpayload">gfxpayload</a></li> <li><a href="#gfxterm_005ffont">gfxterm_font</a></li> <li><a href="#grub_005fcpu">grub_cpu</a></li> <li><a href="#grub_005fplatform">grub_platform</a></li> <li><a href="#icondir">icondir</a></li> <li><a href="#lang">lang</a></li> <li><a href="#locale_005fdir">locale_dir</a></li> <li><a href="#lockdown">lockdown</a></li> <li><a href="#menu_005fcolor_005fhighlight">menu_color_highlight</a></li> <li><a href="#menu_005fcolor_005fnormal">menu_color_normal</a></li> <li><a href="#net_005f_003cinterface_003e_005fboot_005ffile">net_<var class="var"><interface></var>_boot_file</a></li> <li><a href="#net_005f_003cinterface_003e_005fclientid">net_<var class="var"><interface></var>_clientid</a></li> <li><a href="#net_005f_003cinterface_003e_005fclientuuid">net_<var class="var"><interface></var>_clientuuid</a></li> <li><a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname">net_<var class="var"><interface></var>_dhcp_server_name</a></li> <li><a href="#net_005f_003cinterface_003e_005fdomain">net_<var class="var"><interface></var>_domain</a></li> <li><a href="#net_005f_003cinterface_003e_005fextensionspath">net_<var class="var"><interface></var>_extensionspath</a></li> <li><a href="#net_005f_003cinterface_003e_005fhostname">net_<var class="var"><interface></var>_hostname</a></li> <li><a href="#net_005f_003cinterface_003e_005fip">net_<var class="var"><interface></var>_ip</a></li> <li><a href="#net_005f_003cinterface_003e_005fmac">net_<var class="var"><interface></var>_mac</a></li> <li><a href="#net_005f_003cinterface_003e_005fnext_005fserver">net_<var class="var"><interface></var>_next_server</a></li> <li><a href="#net_005f_003cinterface_003e_005frootpath">net_<var class="var"><interface></var>_rootpath</a></li> <li><a href="#net_005fdefault_005finterface">net_default_interface</a></li> <li><a href="#net_005fdefault_005fip">net_default_ip</a></li> <li><a href="#net_005fdefault_005fmac">net_default_mac</a></li> <li><a href="#net_005fdefault_005fserver">net_default_server</a></li> <li><a href="#pager">pager</a></li> <li><a href="#prefix">prefix</a></li> <li><a href="#pxe_005fblksize">pxe_blksize</a></li> <li><a href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a></li> <li><a href="#pxe_005fdefault_005fserver">pxe_default_server</a></li> <li><a href="#root">root</a></li> <li><a href="#shim_005flock">shim_lock</a></li> <li><a href="#superusers">superusers</a></li> <li><a href="#theme">theme</a></li> <li><a href="#timeout">timeout</a></li> <li><a href="#timeout_005fstyle">timeout_style</a></li> <li><a href="#tpm_005ffail_005ffatal">tpm_fail_fatal</a></li> </ul> <hr> <div class="subsection-level-extent" id="biosnum"> <div class="nav-panel"> <p> Next: <a href="#check_005fappended_005fsignatures" accesskey="n" rel="next">check_appended_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="biosnum-1"><span>15.1.1 biosnum<a class="copiable-link" href="#biosnum-1"> ¶</a></span></h4> <p>When chain-loading another boot loader (see <a class="pxref" href="#Chain_002dloading">Chain-loading an OS</a>), GRUB may need to know what BIOS drive number corresponds to the root device (see <a class="pxref" href="#root">root</a>) so that it can set up registers properly. If the <var class="var">biosnum</var> variable is set, it overrides GRUB’s own means of guessing this. </p> <p>For an alternative approach which also changes BIOS drive mappings for the chain-loaded system, see <a class="pxref" href="#drivemap">drivemap</a>. </p> <hr> </div> <div class="subsection-level-extent" id="check_005fappended_005fsignatures"> <div class="nav-panel"> <p> Next: <a href="#check_005fsignatures" accesskey="n" rel="next">check_signatures</a>, Previous: <a href="#biosnum" accesskey="p" rel="prev">biosnum</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="check_005fappended_005fsignatures-1"><span>15.1.2 check_appended_signatures<a class="copiable-link" href="#check_005fappended_005fsignatures-1"> ¶</a></span></h4> <p>This variable controls whether GRUB enforces appended signature validation on certain loaded files. See <a class="xref" href="#Using-appended-signatures">Using appended signatures in GRUB</a>. </p> <hr> </div> <div class="subsection-level-extent" id="check_005fsignatures"> <div class="nav-panel"> <p> Next: <a href="#chosen" accesskey="n" rel="next">chosen</a>, Previous: <a href="#check_005fappended_005fsignatures" accesskey="p" rel="prev">check_appended_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="check_005fsignatures-1"><span>15.1.3 check_signatures<a class="copiable-link" href="#check_005fsignatures-1"> ¶</a></span></h4> <p>This variable controls whether GRUB enforces GPG-style digital signature validation on loaded files. See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>. </p> <hr> </div> <div class="subsection-level-extent" id="chosen"> <div class="nav-panel"> <p> Next: <a href="#cmdpath" accesskey="n" rel="next">cmdpath</a>, Previous: <a href="#check_005fsignatures" accesskey="p" rel="prev">check_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="chosen-1"><span>15.1.4 chosen<a class="copiable-link" href="#chosen-1"> ¶</a></span></h4> <p>When executing a menu entry, GRUB sets the <var class="var">chosen</var> variable to the title of the entry being executed. </p> <p>If the menu entry is in one or more submenus, then <var class="var">chosen</var> is set to the titles of each of the submenus starting from the top level followed by the title of the menu entry itself, separated by ‘<samp class="samp">></samp>’. </p> <hr> </div> <div class="subsection-level-extent" id="cmdpath"> <div class="nav-panel"> <p> Next: <a href="#color_005fhighlight" accesskey="n" rel="next">color_highlight</a>, Previous: <a href="#chosen" accesskey="p" rel="prev">chosen</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cmdpath-1"><span>15.1.5 cmdpath<a class="copiable-link" href="#cmdpath-1"> ¶</a></span></h4> <p>The location from which <samp class="file">core.img</samp> was loaded as an absolute directory name (see <a class="pxref" href="#File-name-syntax">How to specify files</a>). This is set by GRUB at startup based on information returned by platform firmware. Not every platform provides this information and some may return only device without path name. </p> <hr> </div> <div class="subsection-level-extent" id="color_005fhighlight"> <div class="nav-panel"> <p> Next: <a href="#color_005fnormal" accesskey="n" rel="next">color_normal</a>, Previous: <a href="#cmdpath" accesskey="p" rel="prev">cmdpath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="color_005fhighlight-1"><span>15.1.6 color_highlight<a class="copiable-link" href="#color_005fhighlight-1"> ¶</a></span></h4> <p>This variable contains the “highlight” foreground and background terminal colors, separated by a slash (‘<samp class="samp">/</samp>’). Setting this variable changes those colors. For the available color names, see <a class="pxref" href="#color_005fnormal">color_normal</a>. </p> <p>The default is ‘<samp class="samp">black/light-gray</samp>’. </p> <hr> </div> <div class="subsection-level-extent" id="color_005fnormal"> <div class="nav-panel"> <p> Next: <a href="#config_005fdirectory" accesskey="n" rel="next">config_directory</a>, Previous: <a href="#color_005fhighlight" accesskey="p" rel="prev">color_highlight</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="color_005fnormal-1"><span>15.1.7 color_normal<a class="copiable-link" href="#color_005fnormal-1"> ¶</a></span></h4> <p>This variable contains the “normal” foreground and background terminal colors, separated by a slash (‘<samp class="samp">/</samp>’). Setting this variable changes those colors. Each color must be a name from the following list: </p> <ul class="itemize mark-bullet"> <li>black </li><li>blue </li><li>green </li><li>cyan </li><li>red </li><li>magenta </li><li>brown </li><li>light-gray </li><li>dark-gray </li><li>light-blue </li><li>light-green </li><li>light-cyan </li><li>light-red </li><li>light-magenta </li><li>yellow </li><li>white </li></ul> <p>The default is ‘<samp class="samp">light-gray/black</samp>’. </p> <p>The color support support varies from terminal to terminal. </p> <p>‘<samp class="samp">morse</samp>’ has no color support at all. </p> <p>‘<samp class="samp">mda_text</samp>’ color support is limited to highlighting by black/white reversal. </p> <p>‘<samp class="samp">console</samp>’ on ARC, EMU and IEEE1275, ‘<samp class="samp">serial_*</samp>’ and ‘<samp class="samp">spkmodem</samp>’ are governed by terminfo and support only 8 colors if in modes ‘<samp class="samp">vt100-color</samp>’ (default for console on emu), ‘<samp class="samp">arc</samp>’ (default for console on ARC), ‘<samp class="samp">ieee1275</samp>’ (default for console on IEEE1275). When in mode ‘<samp class="samp">vt100</samp>’ then the color support is limited to highlighting by black/white reversal. When in mode ‘<samp class="samp">dumb</samp>’ there is no color support. </p> <p>When console supports no colors this setting is ignored. When console supports 8 colors, then the colors from the second half of the previous list are mapped to the matching colors of first half. </p> <p>‘<samp class="samp">console</samp>’ on EFI and BIOS and ‘<samp class="samp">vga_text</samp>’ support all 16 colors. </p> <p>‘<samp class="samp">gfxterm</samp>’ supports all 16 colors and would be theoretically extendable to support whole rgb24 palette but currently there is no compelling reason to go beyond the current 16 colors. </p> <hr> </div> <div class="subsection-level-extent" id="config_005fdirectory"> <div class="nav-panel"> <p> Next: <a href="#config_005ffile" accesskey="n" rel="next">config_file</a>, Previous: <a href="#color_005fnormal" accesskey="p" rel="prev">color_normal</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="config_005fdirectory-1"><span>15.1.8 config_directory<a class="copiable-link" href="#config_005fdirectory-1"> ¶</a></span></h4> <p>This variable is automatically set by GRUB to the directory part of current configuration file name (see <a class="pxref" href="#config_005ffile">config_file</a>). </p> <hr> </div> <div class="subsection-level-extent" id="config_005ffile"> <div class="nav-panel"> <p> Next: <a href="#debug" accesskey="n" rel="next">debug</a>, Previous: <a href="#config_005fdirectory" accesskey="p" rel="prev">config_directory</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="config_005ffile-1"><span>15.1.9 config_file<a class="copiable-link" href="#config_005ffile-1"> ¶</a></span></h4> <p>This variable is automatically set by GRUB to the name of configuration file that is being processed by commands <code class="command">configfile</code> (see <a class="pxref" href="#configfile">configfile</a>) or <code class="command">normal</code> (see <a class="pxref" href="#normal">normal</a>). It is restored to the previous value when command completes. </p> <hr> </div> <div class="subsection-level-extent" id="debug"> <div class="nav-panel"> <p> Next: <a href="#default" accesskey="n" rel="next">default</a>, Previous: <a href="#config_005ffile" accesskey="p" rel="prev">config_file</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="debug-1"><span>15.1.10 debug<a class="copiable-link" href="#debug-1"> ¶</a></span></h4> <p>This variable may be set to enable debugging output from various components of GRUB. The value is an ordered list of debug facility names separated by whitespace or ‘<samp class="samp">,</samp>’. If the special facility named ‘<samp class="samp">all</samp>’ is present then debugging output of all facility names is enabled at the start of processing the value of this variable. A facility’s debug output can then be disabled by prefixing its name with a ‘<samp class="samp">-</samp>’. The last occurence facility name with or without a leading ‘<samp class="samp">-</samp>’ takes precendent over any previous occurence. This allows the easy enabling or disabling of facilities by appending a ‘<samp class="samp">,</samp>’ and then the facility name with or without the leading ‘<samp class="samp">-</samp>’, which will preserve the state of the rest of the facilities. The facility names are the first argument to grub_dprintf. Consult the source for more details. </p> <hr> </div> <div class="subsection-level-extent" id="default"> <div class="nav-panel"> <p> Next: <a href="#fallback" accesskey="n" rel="next">fallback</a>, Previous: <a href="#debug" accesskey="p" rel="prev">debug</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="default-1"><span>15.1.11 default<a class="copiable-link" href="#default-1"> ¶</a></span></h4> <p>If this variable is set, it identifies a menu entry that should be selected by default, possibly after a timeout (see <a class="pxref" href="#timeout">timeout</a>). The entry may be identified by number (starting from 0 at each level of the hierarchy), by title, or by id. </p> <p>For example, if you have: </p> <pre class="verbatim">menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux { ... } </pre> <p>then you can make this the default using: </p> <div class="example"> <pre class="example-preformatted">default=example-gnu-linux </pre></div> <p>If the entry is in a submenu, then it must be identified using the number, title, or id of each of the submenus starting from the top level, followed by the number, title, or id of the menu entry itself, with each element separated by ‘<samp class="samp">></samp>’. For example, take the following menu structure: </p> <div class="example"> <pre class="example-preformatted">GNU/Hurd --id gnu-hurd Standard Boot --id=gnu-hurd-std Rescue shell --id=gnu-hurd-rescue Other platforms --id=other Minix --id=minix Version 3.4.0 --id=minix-3.4.0 Version 3.3.0 --id=minix-3.3.0 GRUB Invaders --id=grub-invaders </pre></div> <p>The more recent release of Minix would then be identified as ‘<samp class="samp">Other platforms>Minix>Version 3.4.0</samp>’, or as ‘<samp class="samp">1>0>0</samp>’, or as ‘<samp class="samp">other>minix>minix-3.4.0</samp>’. </p> <p>This variable is often set by ‘<samp class="samp">GRUB_DEFAULT</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>), <code class="command">grub2-set-default</code>, or <code class="command">grub2-reboot</code>. </p> <hr> </div> <div class="subsection-level-extent" id="fallback"> <div class="nav-panel"> <p> Next: <a href="#gfxmode" accesskey="n" rel="next">gfxmode</a>, Previous: <a href="#default" accesskey="p" rel="prev">default</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="fallback-1"><span>15.1.12 fallback<a class="copiable-link" href="#fallback-1"> ¶</a></span></h4> <p>If this variable is set, it identifies a menu entry that should be selected if the default menu entry fails to boot. Entries are identified in the same way as for ‘<samp class="samp">default</samp>’ (see <a class="pxref" href="#default">default</a>). </p> <hr> </div> <div class="subsection-level-extent" id="gfxmode"> <div class="nav-panel"> <p> Next: <a href="#gfxpayload" accesskey="n" rel="next">gfxpayload</a>, Previous: <a href="#fallback" accesskey="p" rel="prev">fallback</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gfxmode-1"><span>15.1.13 gfxmode<a class="copiable-link" href="#gfxmode-1"> ¶</a></span></h4> <p>If this variable is set, it sets the resolution used on the ‘<samp class="samp">gfxterm</samp>’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘<samp class="samp">auto</samp>’, which selects a platform-specific default that should look reasonable. Supported modes can be listed by ‘<samp class="samp">videoinfo</samp>’ command in GRUB. </p> <p>The resolution may be specified as a sequence of one or more modes, separated by commas (‘<samp class="samp">,</samp>’) or semicolons (‘<samp class="samp">;</samp>’); each will be tried in turn until one is found. Each mode should be either ‘<samp class="samp">auto</samp>’, ‘<samp class="samp"><var class="var">width</var>x<var class="var">height</var></samp>’, or ‘<samp class="samp"><var class="var">width</var>x<var class="var">height</var>x<var class="var">depth</var></samp>’. </p> <hr> </div> <div class="subsection-level-extent" id="gfxpayload"> <div class="nav-panel"> <p> Next: <a href="#gfxterm_005ffont" accesskey="n" rel="next">gfxterm_font</a>, Previous: <a href="#gfxmode" accesskey="p" rel="prev">gfxmode</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gfxpayload-1"><span>15.1.14 gfxpayload<a class="copiable-link" href="#gfxpayload-1"> ¶</a></span></h4> <p>If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘<samp class="samp">vga=</samp>’ boot option (see <a class="pxref" href="#linux">linux</a>). It may be set to ‘<samp class="samp">text</samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp class="samp">keep</samp>’ to preserve the graphics mode set using ‘<samp class="samp">gfxmode</samp>’, or any of the permitted values for ‘<samp class="samp">gfxmode</samp>’ to set a particular graphics mode (see <a class="pxref" href="#gfxmode">gfxmode</a>). </p> <p>Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this variable to ‘<samp class="samp">text</samp>’ and GRUB will tell Linux to boot in normal text mode. </p> <p>The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is ‘<samp class="samp">text</samp>’. Otherwise the default may be ‘<samp class="samp">auto</samp>’ or a specific video mode. </p> <p>This variable is often set by ‘<samp class="samp">GRUB_GFXPAYLOAD_LINUX</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). </p> <hr> </div> <div class="subsection-level-extent" id="gfxterm_005ffont"> <div class="nav-panel"> <p> Next: <a href="#grub_005fcpu" accesskey="n" rel="next">grub_cpu</a>, Previous: <a href="#gfxpayload" accesskey="p" rel="prev">gfxpayload</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gfxterm_005ffont-1"><span>15.1.15 gfxterm_font<a class="copiable-link" href="#gfxterm_005ffont-1"> ¶</a></span></h4> <p>If this variable is set, it names a font to use for text on the ‘<samp class="samp">gfxterm</samp>’ graphical terminal. Otherwise, ‘<samp class="samp">gfxterm</samp>’ may use any available font. </p> <hr> </div> <div class="subsection-level-extent" id="grub_005fcpu"> <div class="nav-panel"> <p> Next: <a href="#grub_005fplatform" accesskey="n" rel="next">grub_platform</a>, Previous: <a href="#gfxterm_005ffont" accesskey="p" rel="prev">gfxterm_font</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="grub_005fcpu-1"><span>15.1.16 grub_cpu<a class="copiable-link" href="#grub_005fcpu-1"> ¶</a></span></h4> <p>In normal mode (see <a class="pxref" href="#normal">normal</a>), GRUB sets the ‘<samp class="samp">grub_cpu</samp>’ variable to the CPU type for which GRUB was built (e.g. ‘<samp class="samp">i386</samp>’ or ‘<samp class="samp">powerpc</samp>’). </p> <hr> </div> <div class="subsection-level-extent" id="grub_005fplatform"> <div class="nav-panel"> <p> Next: <a href="#icondir" accesskey="n" rel="next">icondir</a>, Previous: <a href="#grub_005fcpu" accesskey="p" rel="prev">grub_cpu</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="grub_005fplatform-1"><span>15.1.17 grub_platform<a class="copiable-link" href="#grub_005fplatform-1"> ¶</a></span></h4> <p>In normal mode (see <a class="pxref" href="#normal">normal</a>), GRUB sets the ‘<samp class="samp">grub_platform</samp>’ variable to the platform for which GRUB was built (e.g. ‘<samp class="samp">pc</samp>’ or ‘<samp class="samp">efi</samp>’). </p> <hr> </div> <div class="subsection-level-extent" id="icondir"> <div class="nav-panel"> <p> Next: <a href="#lang" accesskey="n" rel="next">lang</a>, Previous: <a href="#grub_005fplatform" accesskey="p" rel="prev">grub_platform</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="icondir-1"><span>15.1.18 icondir<a class="copiable-link" href="#icondir-1"> ¶</a></span></h4> <p>If this variable is set, it names a directory in which the GRUB graphical menu should look for icons after looking in the theme’s ‘<samp class="samp">icons</samp>’ directory. See <a class="xref" href="#Theme-file-format">Theme file format</a>. </p> <hr> </div> <div class="subsection-level-extent" id="lang"> <div class="nav-panel"> <p> Next: <a href="#locale_005fdir" accesskey="n" rel="next">locale_dir</a>, Previous: <a href="#icondir" accesskey="p" rel="prev">icondir</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="lang-1"><span>15.1.19 lang<a class="copiable-link" href="#lang-1"> ¶</a></span></h4> <p>If this variable is set, it names the language code that the <code class="command">gettext</code> command (see <a class="pxref" href="#gettext">gettext</a>) uses to translate strings. For example, French would be named as ‘<samp class="samp">fr</samp>’, and Simplified Chinese as ‘<samp class="samp">zh_CN</samp>’. </p> <p><code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>) will try to set a reasonable default for this variable based on the system locale. </p> <hr> </div> <div class="subsection-level-extent" id="locale_005fdir"> <div class="nav-panel"> <p> Next: <a href="#lockdown" accesskey="n" rel="next">lockdown</a>, Previous: <a href="#lang" accesskey="p" rel="prev">lang</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="locale_005fdir-1"><span>15.1.20 locale_dir<a class="copiable-link" href="#locale_005fdir-1"> ¶</a></span></h4> <p>If this variable is set, it names the directory where translation files may be found (see <a class="pxref" href="#gettext">gettext</a>), usually <samp class="file">/boot/grub2/locale</samp>. Otherwise, internationalization is disabled. </p> <p><code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>) will set a reasonable default for this variable if internationalization is needed and any translation files are available. </p> <hr> </div> <div class="subsection-level-extent" id="lockdown"> <div class="nav-panel"> <p> Next: <a href="#menu_005fcolor_005fhighlight" accesskey="n" rel="next">menu_color_highlight</a>, Previous: <a href="#locale_005fdir" accesskey="p" rel="prev">locale_dir</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="lockdown-1"><span>15.1.21 lockdown<a class="copiable-link" href="#lockdown-1"> ¶</a></span></h4> <p>If this variable is set to ‘<samp class="samp">y</samp>’, it means that GRUB has entered see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a> mode. </p> <hr> </div> <div class="subsection-level-extent" id="menu_005fcolor_005fhighlight"> <div class="nav-panel"> <p> Next: <a href="#menu_005fcolor_005fnormal" accesskey="n" rel="next">menu_color_normal</a>, Previous: <a href="#lockdown" accesskey="p" rel="prev">lockdown</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="menu_005fcolor_005fhighlight-1"><span>15.1.22 menu_color_highlight<a class="copiable-link" href="#menu_005fcolor_005fhighlight-1"> ¶</a></span></h4> <p>This variable contains the foreground and background colors to be used for the highlighted menu entry, separated by a slash (‘<samp class="samp">/</samp>’). Setting this variable changes those colors. For the available color names, see <a class="pxref" href="#color_005fnormal">color_normal</a>. </p> <p>The default is the value of ‘<samp class="samp">color_highlight</samp>’ (see <a class="pxref" href="#color_005fhighlight">color_highlight</a>). </p> <hr> </div> <div class="subsection-level-extent" id="menu_005fcolor_005fnormal"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fboot_005ffile" accesskey="n" rel="next">net_<var class="var"><interface></var>_boot_file</a>, Previous: <a href="#menu_005fcolor_005fhighlight" accesskey="p" rel="prev">menu_color_highlight</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="menu_005fcolor_005fnormal-1"><span>15.1.23 menu_color_normal<a class="copiable-link" href="#menu_005fcolor_005fnormal-1"> ¶</a></span></h4> <p>This variable contains the foreground and background colors to be used for non-highlighted menu entries, separated by a slash (‘<samp class="samp">/</samp>’). Setting this variable changes those colors. For the available color names, see <a class="pxref" href="#color_005fnormal">color_normal</a>. </p> <p>The default is the value of ‘<samp class="samp">color_normal</samp>’ (see <a class="pxref" href="#color_005fnormal">color_normal</a>). </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fboot_005ffile"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fclientid" accesskey="n" rel="next">net_<var class="var"><interface></var>_clientid</a>, Previous: <a href="#menu_005fcolor_005fnormal" accesskey="p" rel="prev">menu_color_normal</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fboot_005ffile-1"><span>15.1.24 net_<var class="var"><interface></var>_boot_file<a class="copiable-link" href="#net_005f_003cinterface_003e_005fboot_005ffile-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fclientid"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fclientuuid" accesskey="n" rel="next">net_<var class="var"><interface></var>_clientuuid</a>, Previous: <a href="#net_005f_003cinterface_003e_005fboot_005ffile" accesskey="p" rel="prev">net_<var class="var"><interface></var>_boot_file</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fclientid-1"><span>15.1.25 net_<var class="var"><interface></var>_clientid<a class="copiable-link" href="#net_005f_003cinterface_003e_005fclientid-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fclientuuid"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname" accesskey="n" rel="next">net_<var class="var"><interface></var>_dhcp_server_name</a>, Previous: <a href="#net_005f_003cinterface_003e_005fclientid" accesskey="p" rel="prev">net_<var class="var"><interface></var>_clientid</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fclientuuid-1"><span>15.1.26 net_<var class="var"><interface></var>_clientuuid<a class="copiable-link" href="#net_005f_003cinterface_003e_005fclientuuid-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fdhcp_005fserver_005fname"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fdomain" accesskey="n" rel="next">net_<var class="var"><interface></var>_domain</a>, Previous: <a href="#net_005f_003cinterface_003e_005fclientuuid" accesskey="p" rel="prev">net_<var class="var"><interface></var>_clientuuid</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fdhcp_005fserver_005fname-1"><span>15.1.27 net_<var class="var"><interface></var>_dhcp_server_name<a class="copiable-link" href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fdomain"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fextensionspath" accesskey="n" rel="next">net_<var class="var"><interface></var>_extensionspath</a>, Previous: <a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname" accesskey="p" rel="prev">net_<var class="var"><interface></var>_dhcp_server_name</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fdomain-1"><span>15.1.28 net_<var class="var"><interface></var>_domain<a class="copiable-link" href="#net_005f_003cinterface_003e_005fdomain-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fextensionspath"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fhostname" accesskey="n" rel="next">net_<var class="var"><interface></var>_hostname</a>, Previous: <a href="#net_005f_003cinterface_003e_005fdomain" accesskey="p" rel="prev">net_<var class="var"><interface></var>_domain</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fextensionspath-1"><span>15.1.29 net_<var class="var"><interface></var>_extensionspath<a class="copiable-link" href="#net_005f_003cinterface_003e_005fextensionspath-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fhostname"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fip" accesskey="n" rel="next">net_<var class="var"><interface></var>_ip</a>, Previous: <a href="#net_005f_003cinterface_003e_005fextensionspath" accesskey="p" rel="prev">net_<var class="var"><interface></var>_extensionspath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fhostname-1"><span>15.1.30 net_<var class="var"><interface></var>_hostname<a class="copiable-link" href="#net_005f_003cinterface_003e_005fhostname-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fip"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fmac" accesskey="n" rel="next">net_<var class="var"><interface></var>_mac</a>, Previous: <a href="#net_005f_003cinterface_003e_005fhostname" accesskey="p" rel="prev">net_<var class="var"><interface></var>_hostname</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fip-1"><span>15.1.31 net_<var class="var"><interface></var>_ip<a class="copiable-link" href="#net_005f_003cinterface_003e_005fip-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fmac"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005fnext_005fserver" accesskey="n" rel="next">net_<var class="var"><interface></var>_next_server</a>, Previous: <a href="#net_005f_003cinterface_003e_005fip" accesskey="p" rel="prev">net_<var class="var"><interface></var>_ip</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fmac-1"><span>15.1.32 net_<var class="var"><interface></var>_mac<a class="copiable-link" href="#net_005f_003cinterface_003e_005fmac-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005fnext_005fserver"> <div class="nav-panel"> <p> Next: <a href="#net_005f_003cinterface_003e_005frootpath" accesskey="n" rel="next">net_<var class="var"><interface></var>_rootpath</a>, Previous: <a href="#net_005f_003cinterface_003e_005fmac" accesskey="p" rel="prev">net_<var class="var"><interface></var>_mac</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005fnext_005fserver-1"><span>15.1.33 net_<var class="var"><interface></var>_next_server<a class="copiable-link" href="#net_005f_003cinterface_003e_005fnext_005fserver-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005f_003cinterface_003e_005frootpath"> <div class="nav-panel"> <p> Next: <a href="#net_005fdefault_005finterface" accesskey="n" rel="next">net_default_interface</a>, Previous: <a href="#net_005f_003cinterface_003e_005fnext_005fserver" accesskey="p" rel="prev">net_<var class="var"><interface></var>_next_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005f_003cinterface_003e_005frootpath-1"><span>15.1.34 net_<var class="var"><interface></var>_rootpath<a class="copiable-link" href="#net_005f_003cinterface_003e_005frootpath-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005fdefault_005finterface"> <div class="nav-panel"> <p> Next: <a href="#net_005fdefault_005fip" accesskey="n" rel="next">net_default_ip</a>, Previous: <a href="#net_005f_003cinterface_003e_005frootpath" accesskey="p" rel="prev">net_<var class="var"><interface></var>_rootpath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdefault_005finterface-1"><span>15.1.35 net_default_interface<a class="copiable-link" href="#net_005fdefault_005finterface-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005fdefault_005fip"> <div class="nav-panel"> <p> Next: <a href="#net_005fdefault_005fmac" accesskey="n" rel="next">net_default_mac</a>, Previous: <a href="#net_005fdefault_005finterface" accesskey="p" rel="prev">net_default_interface</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdefault_005fip-1"><span>15.1.36 net_default_ip<a class="copiable-link" href="#net_005fdefault_005fip-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005fdefault_005fmac"> <div class="nav-panel"> <p> Next: <a href="#net_005fdefault_005fserver" accesskey="n" rel="next">net_default_server</a>, Previous: <a href="#net_005fdefault_005fip" accesskey="p" rel="prev">net_default_ip</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdefault_005fmac-1"><span>15.1.37 net_default_mac<a class="copiable-link" href="#net_005fdefault_005fmac-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="net_005fdefault_005fserver"> <div class="nav-panel"> <p> Next: <a href="#pager" accesskey="n" rel="next">pager</a>, Previous: <a href="#net_005fdefault_005fmac" accesskey="p" rel="prev">net_default_mac</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdefault_005fserver-1"><span>15.1.38 net_default_server<a class="copiable-link" href="#net_005fdefault_005fserver-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="pager"> <div class="nav-panel"> <p> Next: <a href="#prefix" accesskey="n" rel="next">prefix</a>, Previous: <a href="#net_005fdefault_005fserver" accesskey="p" rel="prev">net_default_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="pager-1"><span>15.1.39 pager<a class="copiable-link" href="#pager-1"> ¶</a></span></h4> <p>If set to ‘<samp class="samp">1</samp>’, pause output after each screenful and wait for keyboard input. The default is not to pause output. </p> <hr> </div> <div class="subsection-level-extent" id="prefix"> <div class="nav-panel"> <p> Next: <a href="#pxe_005fblksize" accesskey="n" rel="next">pxe_blksize</a>, Previous: <a href="#pager" accesskey="p" rel="prev">pager</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="prefix-1"><span>15.1.40 prefix<a class="copiable-link" href="#prefix-1"> ¶</a></span></h4> <p>The location of the ‘<samp class="samp">/boot/grub</samp>’ directory as an absolute file name (see <a class="pxref" href="#File-name-syntax">How to specify files</a>). This is normally set by GRUB at startup based on information provided by <code class="command">grub2-install</code>. GRUB modules are dynamically loaded from this directory, so it must be set correctly in order for many parts of GRUB to work. </p> <hr> </div> <div class="subsection-level-extent" id="pxe_005fblksize"> <div class="nav-panel"> <p> Next: <a href="#pxe_005fdefault_005fgateway" accesskey="n" rel="next">pxe_default_gateway</a>, Previous: <a href="#prefix" accesskey="p" rel="prev">prefix</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="pxe_005fblksize-1"><span>15.1.41 pxe_blksize<a class="copiable-link" href="#pxe_005fblksize-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="pxe_005fdefault_005fgateway"> <div class="nav-panel"> <p> Next: <a href="#pxe_005fdefault_005fserver" accesskey="n" rel="next">pxe_default_server</a>, Previous: <a href="#pxe_005fblksize" accesskey="p" rel="prev">pxe_blksize</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="pxe_005fdefault_005fgateway-1"><span>15.1.42 pxe_default_gateway<a class="copiable-link" href="#pxe_005fdefault_005fgateway-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="pxe_005fdefault_005fserver"> <div class="nav-panel"> <p> Next: <a href="#root" accesskey="n" rel="next">root</a>, Previous: <a href="#pxe_005fdefault_005fgateway" accesskey="p" rel="prev">pxe_default_gateway</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="pxe_005fdefault_005fserver-1"><span>15.1.43 pxe_default_server<a class="copiable-link" href="#pxe_005fdefault_005fserver-1"> ¶</a></span></h4> <p>See <a class="xref" href="#Network">Booting GRUB from the network</a>. </p> <hr> </div> <div class="subsection-level-extent" id="root"> <div class="nav-panel"> <p> Next: <a href="#shim_005flock" accesskey="n" rel="next">shim_lock</a>, Previous: <a href="#pxe_005fdefault_005fserver" accesskey="p" rel="prev">pxe_default_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="root-1"><span>15.1.44 root<a class="copiable-link" href="#root-1"> ¶</a></span></h4> <p>The root device name (see <a class="pxref" href="#Device-syntax">How to specify devices</a>). Any file names that do not specify an explicit device name are read from this device. The default is normally set by GRUB at startup based on the value of ‘<samp class="samp">prefix</samp>’ (see <a class="pxref" href="#prefix">prefix</a>). </p> <p>For example, if GRUB was installed to the first partition of the first hard disk, then ‘<samp class="samp">prefix</samp>’ might be set to ‘<samp class="samp">(hd0,msdos1)/boot/grub</samp>’ and ‘<samp class="samp">root</samp>’ to ‘<samp class="samp">hd0,msdos1</samp>’. </p> <hr> </div> <div class="subsection-level-extent" id="shim_005flock"> <div class="nav-panel"> <p> Next: <a href="#superusers" accesskey="n" rel="next">superusers</a>, Previous: <a href="#root" accesskey="p" rel="prev">root</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="shim_005flock-1"><span>15.1.45 shim_lock<a class="copiable-link" href="#shim_005flock-1"> ¶</a></span></h4> <p>If this variable is set to ‘<samp class="samp">y</samp>’, it means that the shim_lock verifier is registered (see see <a class="pxref" href="#UEFI-secure-boot-and-shim">UEFI secure boot and shim support</a>). </p> <hr> </div> <div class="subsection-level-extent" id="superusers"> <div class="nav-panel"> <p> Next: <a href="#theme" accesskey="n" rel="next">theme</a>, Previous: <a href="#shim_005flock" accesskey="p" rel="prev">shim_lock</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="superusers-1"><span>15.1.46 superusers<a class="copiable-link" href="#superusers-1"> ¶</a></span></h4> <p>This variable may be set to a list of superuser names to enable authentication support. See <a class="xref" href="#Security">Security</a>. </p> <hr> </div> <div class="subsection-level-extent" id="theme"> <div class="nav-panel"> <p> Next: <a href="#timeout" accesskey="n" rel="next">timeout</a>, Previous: <a href="#superusers" accesskey="p" rel="prev">superusers</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="theme-1"><span>15.1.47 theme<a class="copiable-link" href="#theme-1"> ¶</a></span></h4> <p>This variable may be set to a directory containing a GRUB graphical menu theme. See <a class="xref" href="#Theme-file-format">Theme file format</a>. </p> <p>This variable is often set by ‘<samp class="samp">GRUB_THEME</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). </p> <hr> </div> <div class="subsection-level-extent" id="timeout"> <div class="nav-panel"> <p> Next: <a href="#timeout_005fstyle" accesskey="n" rel="next">timeout_style</a>, Previous: <a href="#theme" accesskey="p" rel="prev">theme</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="timeout-1"><span>15.1.48 timeout<a class="copiable-link" href="#timeout-1"> ¶</a></span></h4> <p>If this variable is set, it specifies the time in seconds to wait for keyboard input before booting the default menu entry. A timeout of ‘<samp class="samp">0</samp>’ means to boot the default entry immediately without displaying the menu; a timeout of ‘<samp class="samp">-1</samp>’ (or unset) means to wait indefinitely. </p> <p>If ‘<samp class="samp">timeout_style</samp>’ (see <a class="pxref" href="#timeout_005fstyle">timeout_style</a>) is set to ‘<samp class="samp">countdown</samp>’ or ‘<samp class="samp">hidden</samp>’, the timeout is instead counted before the menu is displayed. </p> <p>This variable is often set by ‘<samp class="samp">GRUB_TIMEOUT</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). </p> <hr> </div> <div class="subsection-level-extent" id="timeout_005fstyle"> <div class="nav-panel"> <p> Next: <a href="#tpm_005ffail_005ffatal" accesskey="n" rel="next">tpm_fail_fatal</a>, Previous: <a href="#timeout" accesskey="p" rel="prev">timeout</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="timeout_005fstyle-1"><span>15.1.49 timeout_style<a class="copiable-link" href="#timeout_005fstyle-1"> ¶</a></span></h4> <p>This variable may be set to ‘<samp class="samp">menu</samp>’, ‘<samp class="samp">countdown</samp>’, or ‘<samp class="samp">hidden</samp>’ to control the way in which the timeout (see <a class="pxref" href="#timeout">timeout</a>) interacts with displaying the menu. See the documentation of ‘<samp class="samp">GRUB_TIMEOUT_STYLE</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>) for details. </p> <hr> </div> <div class="subsection-level-extent" id="tpm_005ffail_005ffatal"> <div class="nav-panel"> <p> Previous: <a href="#timeout_005fstyle" accesskey="p" rel="prev">timeout_style</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="tpm_005ffail_005ffatal-1"><span>15.1.50 tpm_fail_fatal<a class="copiable-link" href="#tpm_005ffail_005ffatal-1"> ¶</a></span></h4> <p>If this variable is set and true (i.e., not set to “0”, “false”, “disable”, or “no”), TPM measurements that fail will be treated as fatal. Otherwise, they will merely be debug-logged and boot will continue. </p> <p>Call to EFI firmware, like hash_log_extend_event(), can return an unknown error, i.e. due to bug present in firmware. When this variable is set and true (same values as with TPM measurements) this situation will be considered to be fatal and error-logged as “unknown TPM error”. If not set, booting the OS will be enabled. </p> <hr> </div> </div> <div class="section-level-extent" id="Environment-block"> <div class="nav-panel"> <p> Previous: <a href="#Special-environment-variables" accesskey="p" rel="prev">Special environment variables</a>, Up: <a href="#Environment" accesskey="u" rel="up">GRUB environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="The-GRUB-environment-block"><span>15.2 The GRUB environment block<a class="copiable-link" href="#The-GRUB-environment-block"> ¶</a></span></h3> <p>It is often useful to be able to remember a small amount of information from one boot to the next. For example, you might want to set the default menu entry based on what was selected the last time. GRUB deliberately does not implement support for writing files in order to minimise the possibility of the boot loader being responsible for file system corruption, so a GRUB configuration file cannot just create a file in the ordinary way. However, GRUB provides an “environment block” which can be used to save a small amount of state. </p> <p>The environment block is a preallocated 1024-byte file, which normally lives in <samp class="file">/boot/grub2/grubenv</samp> (although you should not assume this). At boot time, the <code class="command">load_env</code> command (see <a class="pxref" href="#load_005fenv">load_env</a>) loads environment variables from it, and the <code class="command">save_env</code> (see <a class="pxref" href="#save_005fenv">save_env</a>) command saves environment variables to it. From a running system, the <code class="command">grub2-editenv</code> utility can be used to edit the environment block. </p> <p>For safety reasons, this storage is only available when installed on a plain disk (no LVM or RAID), using a non-checksumming filesystem (no ZFS), and using BIOS or EFI functions (no ATA, USB or IEEE1275). </p> <p><code class="command">grub2-mkconfig</code> uses this facility to implement ‘<samp class="samp">GRUB_SAVEDEFAULT</samp>’ (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). </p> <hr> </div> </div> <div class="chapter-level-extent" id="Modules"> <div class="nav-panel"> <p> Next: <a href="#Commands" accesskey="n" rel="next">Available commands</a>, Previous: <a href="#Environment" accesskey="p" rel="prev">GRUB environment variables</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Modules-1"><span>16 Modules<a class="copiable-link" href="#Modules-1"> ¶</a></span></h2> <p>In this chapter, we list all modules that are available in GRUB (currently incomplete). </p> <p>Modules can be loaded via the <code class="command">insmod</code> (see <a class="pxref" href="#insmod">insmod</a>) command. </p> <ul class="mini-toc"> <li><a href="#bli" accesskey="1">bli</a></li> </ul> <hr> <div class="section-level-extent" id="bli"> <div class="nav-panel"> <p> Up: <a href="#Modules" accesskey="u" rel="up">Modules</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="bli-1"><span>16.1 bli<a class="copiable-link" href="#bli-1"> ¶</a></span></h3> <p>This module provides basic support for the Boot Loader Interface. The Boot Loader Interface specifies a set of EFI variables that are used to communicate boot-time information between the bootloader and the operating system. </p> <p>The following variables are placed under the vendor UUID <code class="code">4a67b082-0a4c-41cf-b6c7-440b29bb8c4f</code> when the module is loaded: </p> <p>The GPT partition UUID of the EFI System Partition used during boot is published via the <code class="code">LoaderDevicePartUUID</code> variable. The Boot Loader Interface specification requires GPT formatted drives. The bli module ignores drives/partitions in any other format. If GRUB is loaded from a non-GPT partition, e.g. from an MSDOS formatted drive or network, this variable will not be set. </p> <p>A string identifying GRUB as the active bootloader including the version number is stored in <code class="code">LoaderInfo</code>. </p> <p>This module is only available on UEFI platforms. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Commands"> <div class="nav-panel"> <p> Next: <a href="#Internationalisation" accesskey="n" rel="next">Internationalisation</a>, Previous: <a href="#Modules" accesskey="p" rel="prev">Modules</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Available-commands"><span>17 Available commands<a class="copiable-link" href="#Available-commands"> ¶</a></span></h2> <p>In this chapter, we list all commands that are available in GRUB. </p> <p>Commands belong to different groups. A few can only be used in the global section of the configuration file (or “menu”); most of them can be entered on the command-line and can be used either anywhere in the menu or specifically in the menu entries. </p> <p>In rescue mode, only the <code class="command">insmod</code> (see <a class="pxref" href="#insmod">insmod</a>), <code class="command">ls</code> (see <a class="pxref" href="#ls">ls</a>), <code class="command">set</code> (see <a class="pxref" href="#set">set</a>), and <code class="command">unset</code> (see <a class="pxref" href="#unset">unset</a>) commands are normally available. If you end up in rescue mode and do not know what to do, then see <a class="pxref" href="#GRUB-only-offers-a-rescue-shell">GRUB only offers a rescue shell</a>. </p> <ul class="mini-toc"> <li><a href="#Menu_002dspecific-commands" accesskey="1">Commands for the menu only</a></li> <li><a href="#Loader-commands" accesskey="2">Various loader commands</a></li> <li><a href="#General-commands" accesskey="3">General commands</a></li> <li><a href="#Command_002dline-commands" accesskey="4">Command-line commands</a></li> <li><a href="#Networking-commands" accesskey="5">Networking commands</a></li> <li><a href="#Undocumented-commands" accesskey="6">Commands currently undocumented</a></li> </ul> <hr> <div class="section-level-extent" id="Menu_002dspecific-commands"> <div class="nav-panel"> <p> Next: <a href="#Loader-commands" accesskey="n" rel="next">Various loader commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Commands-for-the-menu-only"><span>17.1 Commands for the menu only<a class="copiable-link" href="#Commands-for-the-menu-only"> ¶</a></span></h3> <p>The semantics used in parsing the configuration file are the following: </p> <ul class="itemize mark-bullet"> <li>The files <em class="emph">must</em> be in plain-text format. </li><li>‘<samp class="samp">#</samp>’ at the beginning of a line in a configuration file means it is only a comment. </li><li>Options are separated by spaces. </li><li>All numbers can be either decimal or hexadecimal. A hexadecimal number must be preceded by ‘<samp class="samp">0x</samp>’, and is case-insensitive. </li></ul> <p>These commands can only be used in the menu: </p> <ul class="mini-toc"> <li><a href="#menuentry" accesskey="1">menuentry</a></li> <li><a href="#submenu" accesskey="2">submenu</a></li> </ul> <hr> <div class="subsection-level-extent" id="menuentry"> <div class="nav-panel"> <p> Next: <a href="#submenu" accesskey="n" rel="next">submenu</a>, Up: <a href="#Menu_002dspecific-commands" accesskey="u" rel="up">Commands for the menu only</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="menuentry-1"><span>17.1.1 menuentry<a class="copiable-link" href="#menuentry-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-menuentry"><span class="category-def">Command: </span><span><strong class="def-name">menuentry</strong> <var class="def-var-arguments"><var class="var">title</var> [<samp class="option">--class=class</samp> …] [<samp class="option">--users=users</samp>] [<samp class="option">--unrestricted</samp>] [<samp class="option">--hotkey=key</samp>] [<samp class="option">--id=id</samp>] [<var class="var">arg</var> …] { <var class="var">command</var>; … }</var><a class="copiable-link" href="#index-menuentry"> ¶</a></span></dt> <dd><p>This defines a GRUB menu entry named <var class="var">title</var>. When this entry is selected from the menu, GRUB will set the <var class="var">chosen</var> environment variable to value of <samp class="option">--id</samp> if <samp class="option">--id</samp> is given, execute the list of commands given within braces, and if the last command in the list returned successfully and a kernel was loaded it will execute the <code class="command">boot</code> command. </p> <p>The <samp class="option">--class</samp> option may be used any number of times to group menu entries into classes. Menu themes may display different classes using different styles. </p> <p>The <samp class="option">--users</samp> option grants specific users access to specific menu entries. See <a class="xref" href="#Security">Security</a>. </p> <p>The <samp class="option">--unrestricted</samp> option grants all users access to specific menu entries. See <a class="xref" href="#Security">Security</a>. </p> <p>The <samp class="option">--hotkey</samp> option associates a hotkey with a menu entry. <var class="var">key</var> may be a single letter, or one of the aliases ‘<samp class="samp">backspace</samp>’, ‘<samp class="samp">tab</samp>’, or ‘<samp class="samp">delete</samp>’. </p> <p>The <samp class="option">--id</samp> may be used to associate unique identifier with a menu entry. <var class="var">id</var> is string of ASCII aphanumeric characters, underscore and hyphen and should not start with a digit. </p> <p>All other arguments including <var class="var">title</var> are passed as positional parameters when list of commands is executed with <var class="var">title</var> always assigned to <code class="code">$1</code>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="submenu"> <div class="nav-panel"> <p> Previous: <a href="#menuentry" accesskey="p" rel="prev">menuentry</a>, Up: <a href="#Menu_002dspecific-commands" accesskey="u" rel="up">Commands for the menu only</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="submenu-1"><span>17.1.2 submenu<a class="copiable-link" href="#submenu-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-submenu"><span class="category-def">Command: </span><span><strong class="def-name">submenu</strong> <var class="def-var-arguments"><var class="var">title</var> [<samp class="option">--class=class</samp> …] [<samp class="option">--users=users</samp>] [<samp class="option">--unrestricted</samp>] [<samp class="option">--hotkey=key</samp>] [<samp class="option">--id=id</samp>] { <var class="var">menu entries</var> … }</var><a class="copiable-link" href="#index-submenu"> ¶</a></span></dt> <dd><p>This defines a submenu. An entry called <var class="var">title</var> will be added to the menu; when that entry is selected, a new menu will be displayed showing all the entries within this submenu. </p> <p>All options are the same as in the <code class="command">menuentry</code> command (see <a class="pxref" href="#menuentry">menuentry</a>). </p></dd></dl> <hr> </div> </div> <div class="section-level-extent" id="Loader-commands"> <div class="nav-panel"> <p> Next: <a href="#General-commands" accesskey="n" rel="next">General commands</a>, Previous: <a href="#Menu_002dspecific-commands" accesskey="p" rel="prev">Commands for the menu only</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Various-loader-commands"><span>17.2 Various loader commands<a class="copiable-link" href="#Various-loader-commands"> ¶</a></span></h3> <p>These commands are used to load necessary components to boot desired OS. Many of the loader commands are not sufficiently documented. The following is a list of commands that could use more documentation: </p> <ul class="itemize mark-bullet"> <li><code class="command">appleloader</code> - Boot BIOS-based system. </li><li><code class="command">freedos</code> - Load FreeDOS kernel.sys. </li><li><code class="command">kfreebsd_loadenv</code> - Load FreeBSD env. </li><li><code class="command">kfreebsd_module_elf</code> - Load FreeBSD kernel module (ELF). </li><li><code class="command">kfreebsd_module</code> - Load FreeBSD kernel module. </li><li><code class="command">kfreebsd</code> - Load kernel of FreeBSD. </li><li><code class="command">knetbsd_module_elf</code> - Load NetBSD kernel module (ELF). </li><li><code class="command">knetbsd_module</code> - Load NetBSD kernel module. </li><li><code class="command">knetbsd</code> - Load kernel of NetBSD. </li><li><code class="command">kopenbsd</code> - Load kernel of OpenBSD. </li><li><code class="command">kopenbsd_ramdisk</code> - Load kOpenBSD ramdisk. </li><li><code class="command">legacy_initrd_nounzip</code> - Simulate grub-legacy ‘modulenounzip’ command </li><li><code class="command">legacy_initrd</code> - Simulate grub-legacy ‘initrd’ command </li><li><code class="command">legacy_kernel</code> - Simulate grub-legacy ‘kernel’ command </li><li><code class="command">module2</code> - Load a multiboot 2 module. </li><li><code class="command">module</code> - Load a multiboot module. </li><li><code class="command">multiboot2</code> - Load a multiboot 2 kernel. </li><li><code class="command">multiboot</code> - Load a multiboot kernel. </li><li><code class="command">ntldr</code> - Load NTLDR or BootMGR. </li><li><code class="command">plan9</code> - Load Plan9 kernel. </li><li><code class="command">pxechainloader</code> - Load a PXE image. </li><li><code class="command">truecrypt</code> - Load Truecrypt ISO. </li><li><code class="command">xnu_kernel64</code> - Load 64-bit XNU image. </li><li><code class="command">xnu_kernel</code> - Load XNU image. </li><li><code class="command">xnu_kextdir</code> - Load XNU extension directory. </li><li><code class="command">xnu_kext</code> - Load XNU extension. </li><li><code class="command">xnu_mkext</code> - Load XNU extension package. </li><li><code class="command">xnu_ramdisk</code> - Load XNU ramdisk. It will be available in OS as md0. </li><li><code class="command">xnu_resume</code> - Load an image of hibernated XNU. </li><li><code class="command">xnu_splash</code> - Load a splash image for XNU. </li></ul> <ul class="mini-toc"> <li><a href="#chainloader" accesskey="1">chainloader</a></li> <li><a href="#initrd" accesskey="2">initrd</a></li> <li><a href="#initrd16" accesskey="3">initrd16</a></li> <li><a href="#linux" accesskey="4">linux</a></li> <li><a href="#linux16" accesskey="5">linux16</a></li> <li><a href="#xen_005fhypervisor" accesskey="6">xen_hypervisor</a></li> <li><a href="#xen_005fmodule" accesskey="7">xen_module</a></li> </ul> <hr> <div class="subsection-level-extent" id="chainloader"> <div class="nav-panel"> <p> Next: <a href="#initrd" accesskey="n" rel="next">initrd</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="chainloader-1"><span>17.2.1 chainloader<a class="copiable-link" href="#chainloader-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-chainloader"><span class="category-def">Command: </span><span><strong class="def-name">chainloader</strong> <var class="def-var-arguments">[<samp class="option">--force</samp>] file [args...]</var><a class="copiable-link" href="#index-chainloader"> ¶</a></span></dt> <dd><p>Load <var class="var">file</var> as a chain-loader. Like any other file loaded by the filesystem code, it can use the blocklist notation (see <a class="pxref" href="#Block-list-syntax">How to specify block lists</a>) to grab the first sector of the current partition with ‘<samp class="samp">+1</samp>’. On EFI platforms, any arguments after <var class="var">file</var> will be sent to the loaded image. </p> <p>If you specify the option <samp class="option">--force</samp>, then load <var class="var">file</var> forcibly, whether it has a correct signature or not. This is required when you want to load a defective boot loader, such as SCO UnixWare 7.1. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="initrd"> <div class="nav-panel"> <p> Next: <a href="#initrd16" accesskey="n" rel="next">initrd16</a>, Previous: <a href="#chainloader" accesskey="p" rel="prev">chainloader</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="initrd-1"><span>17.2.2 initrd<a class="copiable-link" href="#initrd-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-initrd"><span class="category-def">Command: </span><span><strong class="def-name">initrd</strong> <var class="def-var-arguments">file [file …]</var><a class="copiable-link" href="#index-initrd"> ¶</a></span></dt> <dd><p>Load, in order, all initrds for a Linux kernel image, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the <code class="command">linux</code> command (see <a class="pxref" href="#linux">linux</a>) has been run. See <a class="ref" href="#GNU_002fLinux">GNU/Linux</a> for more info on booting GNU/Linux. For more information on initrds see the GNU/Linux kernel <a class="uref" href="https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html">documentation</a>. </p> <p>A new-style initrd (for kernels newer than 2.6) containing one file with leading path components can also be generated at run time. This can be done by prefixing an argument with <code class="code">newc:</code> followed by the path of the file in the new initrd, a <code class="code">:</code>, and then the GRUB file path to the file data to be be included. </p> <p>For example: </p><div class="example"> <pre class="example-preformatted">initrd newc:/etc/ssh/config:(hd0,2)/home/user/.ssh/config \ newc:/etc/ssh/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key \ /boot/initrd.gz \ newc:/init:/home/user/init.fixed </pre></div> <p>This command will generate two new-style initrds on the fly. The first contains the path ‘<samp class="samp">/etc/ssh/config</samp>’ with the contents of ‘<samp class="samp">(hd0,2)/home/user/.ssh/config</samp>’ and the path ‘<samp class="samp">/etc/ssh/ssh_host_rsa_key</samp>’ with the contents of ‘<samp class="samp">/etc/ssh/ssh_host_rsa_key</samp>’ on the <var class="var">root</var> device. Parent directory paths will automatically be generated as needed. This first generated initrd will then have ‘<samp class="samp">/boot/initrd.gz</samp>’ concatenated after it. Next, another new-style archive will be generated with the contents of ‘<samp class="samp">/home/user/init.fixed</samp>’ in the path ‘<samp class="samp">/init</samp>’ and appended to the previous concatenation. Finally, the result will be sent to the kernel when booted. </p> <p>Keep in mind that paths that come later will take precedence. So in the example above, the generated path ‘<samp class="samp">/init</samp>’ will overwrite any ‘<samp class="samp">/init</samp>’ in ‘<samp class="samp">/boot/initrd.gz</samp>’. This can be useful when changing the main initrd is undesirable or difficult. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="initrd16"> <div class="nav-panel"> <p> Next: <a href="#linux" accesskey="n" rel="next">linux</a>, Previous: <a href="#initrd" accesskey="p" rel="prev">initrd</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="initrd16-1"><span>17.2.3 initrd16<a class="copiable-link" href="#initrd16-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-initrd16"><span class="category-def">Command: </span><span><strong class="def-name">initrd16</strong> <var class="def-var-arguments">file [file …]</var><a class="copiable-link" href="#index-initrd16"> ¶</a></span></dt> <dd><p>Load, in order, all initrds for a Linux kernel image to be booted in 16-bit mode, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the <code class="command">linux16</code> command (see <a class="pxref" href="#linux16">linux16</a>) has been run. See also <a class="ref" href="#GNU_002fLinux">GNU/Linux</a> and the <code class="command">initrd</code> command (see <a class="pxref" href="#initrd">initrd</a>) for more details on arguments. </p> <p>This command is only available on the pc platform for x86 systems. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="linux"> <div class="nav-panel"> <p> Next: <a href="#linux16" accesskey="n" rel="next">linux16</a>, Previous: <a href="#initrd16" accesskey="p" rel="prev">initrd16</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="linux-1"><span>17.2.4 linux<a class="copiable-link" href="#linux-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-linux"><span class="category-def">Command: </span><span><strong class="def-name">linux</strong> <var class="def-var-arguments">file …</var><a class="copiable-link" href="#index-linux"> ¶</a></span></dt> <dd><p>Load a Linux kernel image from <var class="var">file</var>. The rest of the line is passed verbatim as the <em class="dfn">kernel command-line</em>. Any initrd must be reloaded after using this command (see <a class="pxref" href="#initrd">initrd</a>). </p> <p>On x86 systems, the kernel will be booted using the 32-bit boot protocol. Note that this means that the ‘<samp class="samp">vga=</samp>’ boot option will not work; if you want to set a special video mode, you will need to use GRUB commands such as ‘<samp class="samp">set gfxpayload=1024x768</samp>’ or ‘<samp class="samp">set gfxpayload=keep</samp>’ (to keep the same mode as used in GRUB) instead. GRUB can automatically detect some uses of ‘<samp class="samp">vga=</samp>’ and translate them to appropriate settings of ‘<samp class="samp">gfxpayload</samp>’. The <code class="command">linux16</code> command (see <a class="pxref" href="#linux16">linux16</a>) avoids this restriction. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="linux16"> <div class="nav-panel"> <p> Next: <a href="#xen_005fhypervisor" accesskey="n" rel="next">xen_hypervisor</a>, Previous: <a href="#linux" accesskey="p" rel="prev">linux</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="linux16-1"><span>17.2.5 linux16<a class="copiable-link" href="#linux16-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-linux16"><span class="category-def">Command: </span><span><strong class="def-name">linux16</strong> <var class="def-var-arguments">file …</var><a class="copiable-link" href="#index-linux16"> ¶</a></span></dt> <dd><p>Load a Linux kernel image from <var class="var">file</var> in 16-bit mode. The rest of the line is passed verbatim as the <em class="dfn">kernel command-line</em>. Any initrd must be reloaded after using this command (see <a class="pxref" href="#initrd16">initrd16</a>). </p> <p>The kernel will be booted using the traditional 16-bit boot protocol. As well as bypassing problems with ‘<samp class="samp">vga=</samp>’ described in <a class="ref" href="#linux">linux</a>, this permits booting some other programs that implement the Linux boot protocol for the sake of convenience. </p> <p>This command is only available on x86 systems. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="xen_005fhypervisor"> <div class="nav-panel"> <p> Next: <a href="#xen_005fmodule" accesskey="n" rel="next">xen_module</a>, Previous: <a href="#linux16" accesskey="p" rel="prev">linux16</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="xen_005fhypervisor-1"><span>17.2.6 xen_hypervisor<a class="copiable-link" href="#xen_005fhypervisor-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-xen_005fhypervisor"><span class="category-def">Command: </span><span><strong class="def-name">xen_hypervisor</strong> <var class="def-var-arguments">file [arguments] …</var><a class="copiable-link" href="#index-xen_005fhypervisor"> ¶</a></span></dt> <dd><p>Load a Xen hypervisor binary from <var class="var">file</var>. The rest of the line is passed verbatim as the <em class="dfn">kernel command-line</em>. Any other binaries must be reloaded after using this command. This command is only available on AArch64 systems. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="xen_005fmodule"> <div class="nav-panel"> <p> Previous: <a href="#xen_005fhypervisor" accesskey="p" rel="prev">xen_hypervisor</a>, Up: <a href="#Loader-commands" accesskey="u" rel="up">Various loader commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="xen_005fmodule-1"><span>17.2.7 xen_module<a class="copiable-link" href="#xen_005fmodule-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-xen_005fmodule"><span class="category-def">Command: </span><span><strong class="def-name">xen_module</strong> <var class="def-var-arguments">[–nounzip] file [arguments]</var><a class="copiable-link" href="#index-xen_005fmodule"> ¶</a></span></dt> <dd><p>Load a module for xen hypervisor at the booting process of xen. The rest of the line is passed verbatim as the module command line. Modules should be loaded in the following order: - dom0 kernel image - dom0 ramdisk if present - XSM policy if present This command is only available on AArch64 systems. </p></dd></dl> <hr> </div> </div> <div class="section-level-extent" id="General-commands"> <div class="nav-panel"> <p> Next: <a href="#Command_002dline-commands" accesskey="n" rel="next">Command-line commands</a>, Previous: <a href="#Loader-commands" accesskey="p" rel="prev">Various loader commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="General-commands-1"><span>17.3 General commands<a class="copiable-link" href="#General-commands-1"> ¶</a></span></h3> <p>Commands usable anywhere in the menu and in the command-line. </p> <ul class="mini-toc"> <li><a href="#serial" accesskey="1">serial</a></li> <li><a href="#terminal_005finput" accesskey="2">terminal_input</a></li> <li><a href="#terminal_005foutput" accesskey="3">terminal_output</a></li> <li><a href="#terminfo" accesskey="4">terminfo</a></li> </ul> <hr> <div class="subsection-level-extent" id="serial"> <div class="nav-panel"> <p> Next: <a href="#terminal_005finput" accesskey="n" rel="next">terminal_input</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="serial-1"><span>17.3.1 serial<a class="copiable-link" href="#serial-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-serial"><span class="category-def">Command: </span><span><strong class="def-name">serial</strong> <var class="def-var-arguments">[<samp class="option">--unit=unit</samp>] [<samp class="option">--port=port</samp>] [<samp class="option">--speed=speed</samp>] [<samp class="option">--word=word</samp>] [<samp class="option">--parity=parity</samp>] [<samp class="option">--stop=stop</samp>]</var><a class="copiable-link" href="#index-serial"> ¶</a></span></dt> <dd><p>Initialize a serial device. <var class="var">unit</var> is a number in the range 0-3 specifying which serial port to use; default is 0, which corresponds to the port often called COM1. </p> <p><var class="var">port</var> is the I/O port where the UART is to be found or, if prefixed with ‘<samp class="samp">mmio,</samp>’, the MMIO address of the UART. If specified it takes precedence over <var class="var">unit</var>. </p> <p>Additionally, an MMIO address can be suffixed with: </p><ul class="itemize mark-bullet"> <li>‘<samp class="samp">.b</samp>’ for bytes access (default) </li><li>‘<samp class="samp">.w</samp>’ for 16-bit word access </li><li>‘<samp class="samp">.l</samp>’ for 32-bit long word access or </li><li>‘<samp class="samp">.q</samp>’ for 64-bit long long word access </li></ul> <p>Also, <var class="var">port</var> can be of the form ‘<samp class="samp">pci,XX:XX.X</samp>’ to indicate a serial device exposed on the PCI bus. </p> <p><var class="var">speed</var> is the transmission speed; default is 9600. <var class="var">word</var> and <var class="var">stop</var> are the number of data bits and stop bits. Data bits must be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data bits and one stop bit. <var class="var">parity</var> is one of ‘<samp class="samp">no</samp>’, ‘<samp class="samp">odd</samp>’, ‘<samp class="samp">even</samp>’ and defaults to ‘<samp class="samp">no</samp>’. </p> <p>If passed no <var class="var">unit</var> nor <var class="var">port</var>, or if <var class="var">port</var> is set to ‘<samp class="samp">auto</samp>’ then GRUB will attempt to use ACPI to automatically detect the system default serial port and its configuration. If this information is not available, it will default to <var class="var">unit</var> 0. </p> <p>The serial port is not used as a communication channel unless the <code class="command">terminal_input</code> or <code class="command">terminal_output</code> command is used (see <a class="pxref" href="#terminal_005finput">terminal_input</a>, see <a class="pxref" href="#terminal_005foutput">terminal_output</a>). </p> <p>Note, valid <var class="var">port</var> values, excluding IO port addresses, can be found by listing terminals with <code class="command">terminal_output</code>, selecting all names prefixed by ‘<samp class="samp">serial_</samp>’ and removing that prefix. </p> <p>Examples: </p><div class="example"> <pre class="example-preformatted">serial --port=0x3f8 --speed=9600 serial --port=mmio,fefb0000.l --speed=115200 serial --port=pci,00:16.3 --speed=115200 </pre></div> <p>See also <a class="ref" href="#Serial-terminal">Using GRUB via a serial line</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="terminal_005finput"> <div class="nav-panel"> <p> Next: <a href="#terminal_005foutput" accesskey="n" rel="next">terminal_output</a>, Previous: <a href="#serial" accesskey="p" rel="prev">serial</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="terminal_005finput-1"><span>17.3.2 terminal_input<a class="copiable-link" href="#terminal_005finput-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-terminal_005finput"><span class="category-def">Command: </span><span><strong class="def-name">terminal_input</strong> <var class="def-var-arguments">[<samp class="option">--append</samp>|<samp class="option">--remove</samp>] [terminal1] [terminal2] …</var><a class="copiable-link" href="#index-terminal_005finput"> ¶</a></span></dt> <dd><p>List or select an input terminal. </p> <p>With no arguments, list the active and available input terminals. </p> <p>With <samp class="option">--append</samp>, add the named terminals to the list of active input terminals; any of these may be used to provide input to GRUB. </p> <p>With <samp class="option">--remove</samp>, remove the named terminals from the active list. </p> <p>With no options but a list of terminal names, make only the listed terminal names active. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="terminal_005foutput"> <div class="nav-panel"> <p> Next: <a href="#terminfo" accesskey="n" rel="next">terminfo</a>, Previous: <a href="#terminal_005finput" accesskey="p" rel="prev">terminal_input</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="terminal_005foutput-1"><span>17.3.3 terminal_output<a class="copiable-link" href="#terminal_005foutput-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-terminal_005foutput"><span class="category-def">Command: </span><span><strong class="def-name">terminal_output</strong> <var class="def-var-arguments">[<samp class="option">--append</samp>|<samp class="option">--remove</samp>] [terminal1] [terminal2] …</var><a class="copiable-link" href="#index-terminal_005foutput"> ¶</a></span></dt> <dd><p>List or select an output terminal. </p> <p>With no arguments, list the active and available output terminals. </p> <p>With <samp class="option">--append</samp>, add the named terminals to the list of active output terminals; all of these will receive output from GRUB. </p> <p>With <samp class="option">--remove</samp>, remove the named terminals from the active list. </p> <p>With no options but a list of terminal names, make only the listed terminal names active. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="terminfo"> <div class="nav-panel"> <p> Previous: <a href="#terminal_005foutput" accesskey="p" rel="prev">terminal_output</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="terminfo-1"><span>17.3.4 terminfo<a class="copiable-link" href="#terminfo-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-terminfo"><span class="category-def">Command: </span><span><strong class="def-name">terminfo</strong> <var class="def-var-arguments">[<samp class="option">-a</samp>|<samp class="option">-u</samp>|<samp class="option">-v</samp>] [<samp class="option">-g WxH</samp>] [term] [type]</var><a class="copiable-link" href="#index-terminfo"> ¶</a></span></dt> <dd><p>Define the capabilities of your terminal by giving the name of an entry in the terminfo database, which should correspond roughly to a ‘<samp class="samp">TERM</samp>’ environment variable in Unix. </p> <p>The currently available terminal types are ‘<samp class="samp">vt100</samp>’, ‘<samp class="samp">vt100-color</samp>’, ‘<samp class="samp">ieee1275</samp>’, and ‘<samp class="samp">dumb</samp>’. If you need other terminal types, please contact us to discuss the best way to include support for these in GRUB. </p> <p>The <samp class="option">-a</samp> (<samp class="option">--ascii</samp>), <samp class="option">-u</samp> (<samp class="option">--utf8</samp>), and <samp class="option">-v</samp> (<samp class="option">--visual-utf8</samp>) options control how non-ASCII text is displayed. <samp class="option">-a</samp> specifies an ASCII-only terminal; <samp class="option">-u</samp> specifies logically-ordered UTF-8; and <samp class="option">-v</samp> specifies "visually-ordered UTF-8" (in other words, arranged such that a terminal emulator without bidirectional text support will display right-to-left text in the proper order; this is not really proper UTF-8, but a workaround). </p> <p>The <samp class="option">-g</samp> (<samp class="option">--geometry</samp>) can be used to specify terminal geometry. </p> <p>If no option or terminal type is specified, the current terminal type is printed. </p></dd></dl> <hr> </div> </div> <div class="section-level-extent" id="Command_002dline-commands"> <div class="nav-panel"> <p> Next: <a href="#Networking-commands" accesskey="n" rel="next">Networking commands</a>, Previous: <a href="#General-commands" accesskey="p" rel="prev">General commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Command_002dline-commands-1"><span>17.4 Command-line commands<a class="copiable-link" href="#Command_002dline-commands-1"> ¶</a></span></h3> <p>These commands are usable in the command-line and in menu entries. If you forget a command, you can run the command <code class="command">help</code> (see <a class="pxref" href="#help">help</a>). </p> <ul class="mini-toc"> <li><a href="#g_t_005b" accesskey="1">[</a></li> <li><a href="#acpi" accesskey="2">acpi</a></li> <li><a href="#authenticate" accesskey="3">authenticate</a></li> <li><a href="#background_005fcolor" accesskey="4">background_color</a></li> <li><a href="#background_005fimage" accesskey="5">background_image</a></li> <li><a href="#badram" accesskey="6">badram</a></li> <li><a href="#blocklist" accesskey="7">blocklist</a></li> <li><a href="#boot" accesskey="8">boot</a></li> <li><a href="#cat" accesskey="9">cat</a></li> <li><a href="#clear">clear</a></li> <li><a href="#cmosclean">cmosclean</a></li> <li><a href="#cmosdump">cmosdump</a></li> <li><a href="#cmostest">cmostest</a></li> <li><a href="#cmp">cmp</a></li> <li><a href="#configfile">configfile</a></li> <li><a href="#cpuid">cpuid</a></li> <li><a href="#crc">crc</a></li> <li><a href="#cryptomount">cryptomount</a></li> <li><a href="#cutmem">cutmem</a></li> <li><a href="#date">date</a></li> <li><a href="#devicetree">devicetree</a></li> <li><a href="#distrust">distrust</a></li> <li><a href="#distrust_005fcertificate">distrust_certificate</a></li> <li><a href="#drivemap">drivemap</a></li> <li><a href="#echo">echo</a></li> <li><a href="#efitextmode">efitextmode</a></li> <li><a href="#eval">eval</a></li> <li><a href="#export">export</a></li> <li><a href="#false">false</a></li> <li><a href="#fwsetup">fwsetup</a></li> <li><a href="#gdbinfo">gdbinfo</a></li> <li><a href="#gettext">gettext</a></li> <li><a href="#gptsync">gptsync</a></li> <li><a href="#halt">halt</a></li> <li><a href="#hashsum">hashsum</a></li> <li><a href="#help">help</a></li> <li><a href="#hexdump">hexdump</a></li> <li><a href="#insmod">insmod</a></li> <li><a href="#keystatus">keystatus</a></li> <li><a href="#list_005fcertificates">list_certificates</a></li> <li><a href="#list_005fenv">list_env</a></li> <li><a href="#list_005ftrusted">list_trusted</a></li> <li><a href="#load_005fenv">load_env</a></li> <li><a href="#loadfont">loadfont</a></li> <li><a href="#loopback">loopback</a></li> <li><a href="#ls">ls</a></li> <li><a href="#lsfonts">lsfonts</a></li> <li><a href="#lsmod">lsmod</a></li> <li><a href="#md5sum">md5sum</a></li> <li><a href="#module">module</a></li> <li><a href="#multiboot">multiboot</a></li> <li><a href="#nativedisk">nativedisk</a></li> <li><a href="#normal">normal</a></li> <li><a href="#normal_005fexit">normal_exit</a></li> <li><a href="#parttool">parttool</a></li> <li><a href="#password">password</a></li> <li><a href="#password_005fpbkdf2">password_pbkdf2</a></li> <li><a href="#plainmount">plainmount</a></li> <li><a href="#play">play</a></li> <li><a href="#probe">probe</a></li> <li><a href="#rdmsr">rdmsr</a></li> <li><a href="#read">read</a></li> <li><a href="#reboot">reboot</a></li> <li><a href="#regexp">regexp</a></li> <li><a href="#rmmod">rmmod</a></li> <li><a href="#save_005fenv">save_env</a></li> <li><a href="#search">search</a></li> <li><a href="#sendkey">sendkey</a></li> <li><a href="#set">set</a></li> <li><a href="#sha1sum">sha1sum</a></li> <li><a href="#sha256sum">sha256sum</a></li> <li><a href="#sha512sum">sha512sum</a></li> <li><a href="#sleep">sleep</a></li> <li><a href="#smbios">smbios</a></li> <li><a href="#source">source</a></li> <li><a href="#test">test</a></li> <li><a href="#true">true</a></li> <li><a href="#trust">trust</a></li> <li><a href="#trust_005fcertificate">trust_certificate</a></li> <li><a href="#unset">unset</a></li> <li><a href="#verify_005fappended">verify_appended</a></li> <li><a href="#verify_005fdetached">verify_detached</a></li> <li><a href="#videoinfo">videoinfo</a></li> <li><a href="#wrmsr">wrmsr</a></li> </ul> <hr> <div class="subsection-level-extent" id="g_t_005b"> <div class="nav-panel"> <p> Next: <a href="#acpi" accesskey="n" rel="next">acpi</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="g_t_005b-1"><span>17.4.1 [<a class="copiable-link" href="#g_t_005b-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-_005b"><span class="category-def">Command: </span><span><strong class="def-name"><code class="code">[</code></strong> <var class="def-var-arguments">expression <code class="code">]</code></var><a class="copiable-link" href="#index-_005b"> ¶</a></span></dt> <dd><p>Alias for <code class="code">test <var class="var">expression</var></code> (see <a class="pxref" href="#test">test</a>). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="acpi"> <div class="nav-panel"> <p> Next: <a href="#authenticate" accesskey="n" rel="next">authenticate</a>, Previous: <a href="#g_t_005b" accesskey="p" rel="prev">[</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="acpi-1"><span>17.4.2 acpi<a class="copiable-link" href="#acpi-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-acpi"><span class="category-def">Command: </span><span><strong class="def-name">acpi</strong> <var class="def-var-arguments">[<samp class="option">-1</samp>|<samp class="option">-2</samp>] [<samp class="option">--exclude=table1,…</samp>|<samp class="option">--load-only=table1,…</samp>] [<samp class="option">--oemid=id</samp>] [<samp class="option">--oemtable=table</samp>] [<samp class="option">--oemtablerev=rev</samp>] [<samp class="option">--oemtablecreator=creator</samp>] [<samp class="option">--oemtablecreatorrev=rev</samp>] [<samp class="option">--no-ebda</samp>] filename …</var><a class="copiable-link" href="#index-acpi"> ¶</a></span></dt> <dd><p>Modern BIOS systems normally implement the Advanced Configuration and Power Interface (ACPI), and define various tables that describe the interface between an ACPI-compliant operating system and the firmware. In some cases, the tables provided by default only work well with certain operating systems, and it may be necessary to replace some of them. </p> <p>Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the <samp class="option">--no-ebda</samp> option is used, the new tables will be known only to GRUB, but may be used by GRUB’s EFI emulation. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). Otherwise an attacker can instruct the GRUB to load an SSDT table to overwrite the kernel lockdown configuration and later load and execute unsigned code. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="authenticate"> <div class="nav-panel"> <p> Next: <a href="#background_005fcolor" accesskey="n" rel="next">background_color</a>, Previous: <a href="#acpi" accesskey="p" rel="prev">acpi</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="authenticate-1"><span>17.4.3 authenticate<a class="copiable-link" href="#authenticate-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-authenticate"><span class="category-def">Command: </span><span><strong class="def-name">authenticate</strong> <var class="def-var-arguments">[userlist]</var><a class="copiable-link" href="#index-authenticate"> ¶</a></span></dt> <dd><p>Check whether user is in <var class="var">userlist</var> or listed in the value of variable ‘<samp class="samp">superusers</samp>’. See see <a class="pxref" href="#superusers">superusers</a> for valid user list format. If ‘<samp class="samp">superusers</samp>’ is empty, this command returns true. See <a class="xref" href="#Security">Security</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="background_005fcolor"> <div class="nav-panel"> <p> Next: <a href="#background_005fimage" accesskey="n" rel="next">background_image</a>, Previous: <a href="#authenticate" accesskey="p" rel="prev">authenticate</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="background_005fcolor-1"><span>17.4.4 background_color<a class="copiable-link" href="#background_005fcolor-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-background_005fcolor"><span class="category-def">Command: </span><span><strong class="def-name">background_color</strong> <var class="def-var-arguments">color</var><a class="copiable-link" href="#index-background_005fcolor"> ¶</a></span></dt> <dd><p>Set background color for active terminal. For valid color specifications see see <a class="pxref" href="#Theme-file-format">Colors</a>. Background color can be changed only when using ‘<samp class="samp">gfxterm</samp>’ for terminal output. </p> <p>This command sets color of empty areas without text. Text background color is controlled by environment variables <var class="var">color_normal</var>, <var class="var">color_highlight</var>, <var class="var">menu_color_normal</var>, <var class="var">menu_color_highlight</var>. See <a class="xref" href="#Special-environment-variables">Special environment variables</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="background_005fimage"> <div class="nav-panel"> <p> Next: <a href="#badram" accesskey="n" rel="next">badram</a>, Previous: <a href="#background_005fcolor" accesskey="p" rel="prev">background_color</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="background_005fimage-1"><span>17.4.5 background_image<a class="copiable-link" href="#background_005fimage-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-background_005fimage"><span class="category-def">Command: </span><span><strong class="def-name">background_image</strong> <var class="def-var-arguments">[[<samp class="option">--mode</samp> ‘<samp class="samp">stretch</samp>’|‘<samp class="samp">normal</samp>’] file]</var><a class="copiable-link" href="#index-background_005fimage"> ¶</a></span></dt> <dd><p>Load background image for active terminal from <var class="var">file</var>. Image is stretched to fill up entire screen unless option <samp class="option">--mode</samp> ‘<samp class="samp">normal</samp>’ is given. Without arguments remove currently loaded background image. Background image can be changed only when using ‘<samp class="samp">gfxterm</samp>’ for terminal output. </p> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="badram"> <div class="nav-panel"> <p> Next: <a href="#blocklist" accesskey="n" rel="next">blocklist</a>, Previous: <a href="#background_005fimage" accesskey="p" rel="prev">background_image</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="badram-1"><span>17.4.6 badram<a class="copiable-link" href="#badram-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-badram"><span class="category-def">Command: </span><span><strong class="def-name">badram</strong> <var class="def-var-arguments">addr,mask[,addr,mask...]</var><a class="copiable-link" href="#index-badram"> ¶</a></span></dt> <dd><p>Filter out bad RAM. </p> <p>This command notifies the memory manager that specified regions of RAM ought to be filtered out (usually, because they’re damaged). This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general. </p> <p>Syntax is the same as provided by the <a class="uref" href="http://www.memtest.org/">Memtest86+ utility</a>: a list of address/mask pairs. Given a page-aligned address and a base address / mask pair, if all the bits of the page-aligned address that are enabled by the mask match with the base address, it means this page is to be filtered. This syntax makes it easy to represent patterns that are often result of memory damage, due to physical distribution of memory cells. </p> <p>The command is similar to <code class="command">cutmem</code> command. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). This prevents removing EFI memory regions to potentially subvert the security mechanisms provided by the UEFI secure boot. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="blocklist"> <div class="nav-panel"> <p> Next: <a href="#boot" accesskey="n" rel="next">boot</a>, Previous: <a href="#badram" accesskey="p" rel="prev">badram</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="blocklist-1"><span>17.4.7 blocklist<a class="copiable-link" href="#blocklist-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-blocklist"><span class="category-def">Command: </span><span><strong class="def-name">blocklist</strong> <var class="def-var-arguments">file</var><a class="copiable-link" href="#index-blocklist"> ¶</a></span></dt> <dd><p>Print a block list (see <a class="pxref" href="#Block-list-syntax">How to specify block lists</a>) for <var class="var">file</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="boot"> <div class="nav-panel"> <p> Next: <a href="#cat" accesskey="n" rel="next">cat</a>, Previous: <a href="#blocklist" accesskey="p" rel="prev">blocklist</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="boot-1"><span>17.4.8 boot<a class="copiable-link" href="#boot-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-boot"><span class="category-def">Command: </span><span><strong class="def-name">boot</strong><a class="copiable-link" href="#index-boot"> ¶</a></span></dt> <dd><p>Boot the OS or chain-loader which has been loaded. Only necessary if running the fully interactive command-line (it is implicit at the end of a menu entry). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cat"> <div class="nav-panel"> <p> Next: <a href="#clear" accesskey="n" rel="next">clear</a>, Previous: <a href="#boot" accesskey="p" rel="prev">boot</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cat-1"><span>17.4.9 cat<a class="copiable-link" href="#cat-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cat"><span class="category-def">Command: </span><span><strong class="def-name">cat</strong> <var class="def-var-arguments">[<samp class="option">--dos</samp>] file</var><a class="copiable-link" href="#index-cat"> ¶</a></span></dt> <dd><p>Display the contents of the file <var class="var">file</var>. This command may be useful to remind you of your OS’s root partition: </p> <div class="example"> <pre class="example-preformatted">grub> <kbd class="kbd">cat /etc/fstab</kbd> </pre></div> <p>If the <samp class="option">--dos</samp> option is used, then carriage return / new line pairs will be displayed as a simple new line. Otherwise, the carriage return will be displayed as a control character (‘<samp class="samp"><d></samp>’) to make it easier to see when boot problems are caused by a file formatted using DOS-style line endings. </p> <p>Note: <code class="command">cat</code> can be used to view the contents of devices using the block list syntax (see <a class="pxref" href="#Block-list-syntax">How to specify block lists</a>). However, it is not advised to view binary data because it will try to decode UTF-8 strings, which can lead to some bytes missing or added in the output. Instead, use the <code class="command">hexdump</code> command (see <a class="pxref" href="#hexdump">hexdump</a>). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="clear"> <div class="nav-panel"> <p> Next: <a href="#cmosclean" accesskey="n" rel="next">cmosclean</a>, Previous: <a href="#cat" accesskey="p" rel="prev">cat</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="clear-1"><span>17.4.10 clear<a class="copiable-link" href="#clear-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-clear"><span class="category-def">Command: </span><span><strong class="def-name">clear</strong><a class="copiable-link" href="#index-clear"> ¶</a></span></dt> <dd><p>Clear the screen. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cmosclean"> <div class="nav-panel"> <p> Next: <a href="#cmosdump" accesskey="n" rel="next">cmosdump</a>, Previous: <a href="#clear" accesskey="p" rel="prev">clear</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cmosclean-1"><span>17.4.11 cmosclean<a class="copiable-link" href="#cmosclean-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cmosclean"><span class="category-def">Command: </span><span><strong class="def-name">cmosclean</strong> <var class="def-var-arguments">byte:bit</var><a class="copiable-link" href="#index-cmosclean"> ¶</a></span></dt> <dd><p>Clear value of bit in CMOS at location <var class="var">byte</var>:<var class="var">bit</var>. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cmosdump"> <div class="nav-panel"> <p> Next: <a href="#cmostest" accesskey="n" rel="next">cmostest</a>, Previous: <a href="#cmosclean" accesskey="p" rel="prev">cmosclean</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cmosdump-1"><span>17.4.12 cmosdump<a class="copiable-link" href="#cmosdump-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-CMOS"><span class="category-def">Dump: </span><span><strong class="def-name">CMOS</strong> <var class="def-var-arguments">contents</var><a class="copiable-link" href="#index-CMOS"> ¶</a></span></dt> <dd><p>Dump full CMOS contents as hexadecimal values. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cmostest"> <div class="nav-panel"> <p> Next: <a href="#cmp" accesskey="n" rel="next">cmp</a>, Previous: <a href="#cmosdump" accesskey="p" rel="prev">cmosdump</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cmostest-1"><span>17.4.13 cmostest<a class="copiable-link" href="#cmostest-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cmostest"><span class="category-def">Command: </span><span><strong class="def-name">cmostest</strong> <var class="def-var-arguments">byte:bit</var><a class="copiable-link" href="#index-cmostest"> ¶</a></span></dt> <dd><p>Test value of bit in CMOS at location <var class="var">byte</var>:<var class="var">bit</var>. Exit status is zero if bit is set, non zero otherwise. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cmp"> <div class="nav-panel"> <p> Next: <a href="#configfile" accesskey="n" rel="next">configfile</a>, Previous: <a href="#cmostest" accesskey="p" rel="prev">cmostest</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cmp-1"><span>17.4.14 cmp<a class="copiable-link" href="#cmp-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cmp"><span class="category-def">Command: </span><span><strong class="def-name">cmp</strong> <var class="def-var-arguments">[<samp class="option">-v</samp>] file1 file2</var><a class="copiable-link" href="#index-cmp"> ¶</a></span></dt> <dd><p>Compare the file <var class="var">file1</var> with the file <var class="var">file2</var>. If they are completely identical, <code class="code">$?</code> will be set to 0. Otherwise, if the files are not identical, <code class="code">$?</code> will be set to a nonzero value. </p> <p>By default nothing will be output. If the <samp class="option">-v</samp> is used, verbose mode is enabled. In this mode when when the files differ in size, print the sizes like this: </p> <div class="example"> <pre class="example-preformatted">Differ in size: 0x1234 [foo], 0x4321 [bar] </pre></div> <p>If the sizes are equal but the bytes at an offset differ, then print the bytes like this: </p> <div class="example"> <pre class="example-preformatted">Differ at the offset 777: 0xbe [foo], 0xef [bar] </pre></div> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="configfile"> <div class="nav-panel"> <p> Next: <a href="#cpuid" accesskey="n" rel="next">cpuid</a>, Previous: <a href="#cmp" accesskey="p" rel="prev">cmp</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="configfile-1"><span>17.4.15 configfile<a class="copiable-link" href="#configfile-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-configfile"><span class="category-def">Command: </span><span><strong class="def-name">configfile</strong> <var class="def-var-arguments">file</var><a class="copiable-link" href="#index-configfile"> ¶</a></span></dt> <dd><p>Load <var class="var">file</var> as a configuration file. If <var class="var">file</var> defines any menu entries, then show a menu containing them immediately. Any environment variable changes made by the commands in <var class="var">file</var> will not be preserved after <code class="command">configfile</code> returns. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cpuid"> <div class="nav-panel"> <p> Next: <a href="#crc" accesskey="n" rel="next">crc</a>, Previous: <a href="#configfile" accesskey="p" rel="prev">configfile</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cpuid-1"><span>17.4.16 cpuid<a class="copiable-link" href="#cpuid-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cpuid"><span class="category-def">Command: </span><span><strong class="def-name">cpuid</strong> <var class="def-var-arguments">[-l] [-p]</var><a class="copiable-link" href="#index-cpuid"> ¶</a></span></dt> <dd><p>Check for CPU features. This command is only available on x86 systems. </p> <p>With the <samp class="option">-l</samp> option, return true if the CPU supports long mode (64-bit). </p> <p>With the <samp class="option">-p</samp> option, return true if the CPU supports Physical Address Extension (PAE). </p> <p>If invoked without options, this command currently behaves as if it had been invoked with <samp class="option">-l</samp>. This may change in the future. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="crc"> <div class="nav-panel"> <p> Next: <a href="#cryptomount" accesskey="n" rel="next">cryptomount</a>, Previous: <a href="#cpuid" accesskey="p" rel="prev">cpuid</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="crc-1"><span>17.4.17 crc<a class="copiable-link" href="#crc-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-crc"><span class="category-def">Command: </span><span><strong class="def-name">crc</strong> <var class="def-var-arguments">arg …</var><a class="copiable-link" href="#index-crc"> ¶</a></span></dt> <dd><p>Alias for <code class="code">hashsum --hash crc32 arg …</code>. See command <code class="command">hashsum</code> (see <a class="pxref" href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cryptomount"> <div class="nav-panel"> <p> Next: <a href="#cutmem" accesskey="n" rel="next">cutmem</a>, Previous: <a href="#crc" accesskey="p" rel="prev">crc</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cryptomount-1"><span>17.4.18 cryptomount<a class="copiable-link" href="#cryptomount-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cryptomount"><span class="category-def">Command: </span><span><strong class="def-name">cryptomount</strong> <var class="def-var-arguments">[ [<samp class="option">-p</samp> password] | [<samp class="option">-k</samp> keyfile [<samp class="option">-O</samp> keyoffset] [<samp class="option">-S</samp> keysize] ] ] [<samp class="option">-H</samp> file] device|<samp class="option">-u</samp> uuid|<samp class="option">-a</samp>|<samp class="option">-b</samp></var><a class="copiable-link" href="#index-cryptomount"> ¶</a></span></dt> <dd><p>Setup access to encrypted device. A passphrase will be requested interactively, if neither the <samp class="option">-p</samp> nor <samp class="option">-k</samp> options are given. The option <samp class="option">-p</samp> can be used to supply a passphrase (useful for scripts). Alternatively the <samp class="option">-k</samp> option can be used to supply a keyfile with options <samp class="option">-O</samp> and <samp class="option">-S</samp> optionally supplying the offset and size, respectively, of the key data in the given key file. The <samp class="option">-H</samp> options can be used to supply cryptomount backends with an alternative header file (aka detached header). Not all backends have headers nor support alternative header files (currently only LUKS1 and LUKS2 support them). Argument <var class="var">device</var> configures specific grub device (see <a class="pxref" href="#Naming-convention">Naming convention</a>); option <samp class="option">-u</samp> <var class="var">uuid</var> configures device with specified <var class="var">uuid</var>; option <samp class="option">-a</samp> configures all detected encrypted devices; option <samp class="option">-b</samp> configures all geli containers that have boot flag set. </p> <p>Devices are not allowed to be given as key files nor as detached header files. However, this limitation can be worked around by using blocklist syntax. So for instance, <code class="code">(hd1,gpt2)</code> can not be used, but <code class="code">(hd1,gpt2)0+</code> will achieve the desired result. </p> <p>GRUB suports devices encrypted using LUKS, LUKS2 and geli. Note that necessary modules (<var class="var">luks</var>, <var class="var">luks2</var> and <var class="var">geli</var>) have to be loaded manually before this command can be used. For LUKS2 only the PBKDF2 key derivation function is supported, as Argon2 is not yet supported. </p> <p>Successfully decrypted disks are named as (cryptoX) and have increasing numeration suffix for each new decrypted disk. If the encrypted disk hosts some higher level of abstraction (like LVM2 or MDRAID) it will be created under a separate device namespace in addition to the cryptodisk namespace. </p> <p>Support for plain encryption mode (plain dm-crypt) is provided via separate <code class="command">see <a class="pxref" href="#plainmount">plainmount</a></code> command. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="cutmem"> <div class="nav-panel"> <p> Next: <a href="#date" accesskey="n" rel="next">date</a>, Previous: <a href="#cryptomount" accesskey="p" rel="prev">cryptomount</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="cutmem-1"><span>17.4.19 cutmem<a class="copiable-link" href="#cutmem-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-cutmem"><span class="category-def">Command: </span><span><strong class="def-name">cutmem</strong> <var class="def-var-arguments">from[K|M|G] to[K|M|G]</var><a class="copiable-link" href="#index-cutmem"> ¶</a></span></dt> <dd><p>Remove any memory regions in specified range. </p> <p>This command notifies the memory manager that specified regions of RAM ought to be filtered out. This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general. </p> <p>The command is similar to <code class="command">badram</code> command. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). This prevents removing EFI memory regions to potentially subvert the security mechanisms provided by the UEFI secure boot. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="date"> <div class="nav-panel"> <p> Next: <a href="#devicetree" accesskey="n" rel="next">devicetree</a>, Previous: <a href="#cutmem" accesskey="p" rel="prev">cutmem</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="date-1"><span>17.4.20 date<a class="copiable-link" href="#date-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-date"><span class="category-def">Command: </span><span><strong class="def-name">date</strong> <var class="def-var-arguments">[[year-]month-day] [hour:minute[:second]]</var><a class="copiable-link" href="#index-date"> ¶</a></span></dt> <dd><p>With no arguments, print the current date and time. </p> <p>Otherwise, take the current date and time, change any elements specified as arguments, and set the result as the new date and time. For example, ‘date 01-01’ will set the current month and day to January 1, but leave the year, hour, minute, and second unchanged. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="devicetree"> <div class="nav-panel"> <p> Next: <a href="#distrust" accesskey="n" rel="next">distrust</a>, Previous: <a href="#date" accesskey="p" rel="prev">date</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="devicetree-1"><span>17.4.21 devicetree<a class="copiable-link" href="#devicetree-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-devicetree"><span class="category-def">Command: </span><span><strong class="def-name">devicetree</strong> <var class="def-var-arguments">file</var><a class="copiable-link" href="#index-devicetree"> ¶</a></span></dt> <dd><p>Load a device tree blob (.dtb) from a filesystem, for later use by a Linux kernel. Does not perform merging with any device tree supplied by firmware, but rather replaces it completely. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). This is done to prevent subverting various security mechanisms. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="distrust"> <div class="nav-panel"> <p> Next: <a href="#distrust_005fcertificate" accesskey="n" rel="next">distrust_certificate</a>, Previous: <a href="#devicetree" accesskey="p" rel="prev">devicetree</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="distrust-1"><span>17.4.22 distrust<a class="copiable-link" href="#distrust-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-distrust"><span class="category-def">Command: </span><span><strong class="def-name">distrust</strong> <var class="def-var-arguments">pubkey_id</var><a class="copiable-link" href="#index-distrust"> ¶</a></span></dt> <dd><p>Remove public key <var class="var">pubkey_id</var> from GRUB’s keyring of trusted keys. <var class="var">pubkey_id</var> is the last four bytes (eight hexadecimal digits) of the GPG v4 key id, which is also the output of <code class="command">list_trusted</code> (see <a class="pxref" href="#list_005ftrusted">list_trusted</a>). Outside of GRUB, the key id can be obtained using <code class="code">gpg --fingerprint</code>). These keys are used to validate signatures when environment variable <code class="code">check_signatures</code> is set to <code class="code">enforce</code> (see <a class="pxref" href="#check_005fsignatures">check_signatures</a>), and by some invocations of <code class="command">verify_detached</code> (see <a class="pxref" href="#verify_005fdetached">verify_detached</a>). See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="distrust_005fcertificate"> <div class="nav-panel"> <p> Next: <a href="#drivemap" accesskey="n" rel="next">drivemap</a>, Previous: <a href="#distrust" accesskey="p" rel="prev">distrust</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="distrust_005fcertificate-1"><span>17.4.23 distrust_certificate<a class="copiable-link" href="#distrust_005fcertificate-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-distrust_005fcertificate"><span class="category-def">Command: </span><span><strong class="def-name">distrust_certificate</strong> <var class="def-var-arguments">cert_number</var><a class="copiable-link" href="#index-distrust_005fcertificate"> ¶</a></span></dt> <dd><p>Remove the x509 certificate numbered <var class="var">cert_number</var> from GRUB’s keyring of trusted x509 certificates for verifying appended signatures. </p> <p><var class="var">cert_number</var> is the certificate number as listed by <code class="command">list_certificates</code> (see <a class="pxref" href="#list_005fcertificates">list_certificates</a>). </p> <p>These certificates are used to validate appended signatures when environment variable <code class="code">check_appended_signatures</code> is set to <code class="code">enforce</code> or <code class="code">forced</code> (see <a class="pxref" href="#check_005fappended_005fsignatures">check_appended_signatures</a>), and by <code class="command">verify_appended</code> (see <a class="pxref" href="#verify_005fappended">verify_appended</a>). See See <a class="xref" href="#Using-appended-signatures">Using appended signatures in GRUB</a> for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="drivemap"> <div class="nav-panel"> <p> Next: <a href="#echo" accesskey="n" rel="next">echo</a>, Previous: <a href="#distrust_005fcertificate" accesskey="p" rel="prev">distrust_certificate</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="drivemap-1"><span>17.4.24 drivemap<a class="copiable-link" href="#drivemap-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-drivemap"><span class="category-def">Command: </span><span><strong class="def-name">drivemap</strong> <var class="def-var-arguments"><samp class="option">-l</samp>|<samp class="option">-r</samp>|[<samp class="option">-s</samp>] from_drive to_drive</var><a class="copiable-link" href="#index-drivemap"> ¶</a></span></dt> <dd><p>Without options, map the drive <var class="var">from_drive</var> to the drive <var class="var">to_drive</var>. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. For convenience, any partition suffix on the drive is ignored, so you can safely use <code class="verb">${root}</code> as a drive specification. </p> <p>With the <samp class="option">-s</samp> option, perform the reverse mapping as well, swapping the two drives. </p> <p>With the <samp class="option">-l</samp> option, list the current mappings. </p> <p>With the <samp class="option">-r</samp> option, reset all mappings to the default values. </p> <p>For example: </p> <div class="example"> <pre class="example-preformatted">drivemap -s (hd0) (hd1) </pre></div> <p>NOTE: Only available on i386-pc. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="echo"> <div class="nav-panel"> <p> Next: <a href="#efitextmode" accesskey="n" rel="next">efitextmode</a>, Previous: <a href="#drivemap" accesskey="p" rel="prev">drivemap</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="echo-1"><span>17.4.25 echo<a class="copiable-link" href="#echo-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-echo"><span class="category-def">Command: </span><span><strong class="def-name">echo</strong> <var class="def-var-arguments">[<samp class="option">-n</samp>] [<samp class="option">-e</samp>] string …</var><a class="copiable-link" href="#index-echo"> ¶</a></span></dt> <dd><p>Display the requested text and, unless the <samp class="option">-n</samp> option is used, a trailing new line. If there is more than one string, they are separated by spaces in the output. As usual in GRUB commands, variables may be substituted using ‘<samp class="samp">${var}</samp>’. </p> <p>The <samp class="option">-e</samp> option enables interpretation of backslash escapes. The following sequences are recognised: </p> <dl class="table"> <dt><code class="code">\\</code></dt> <dd><p>backslash </p> </dd> <dt><code class="code">\a</code></dt> <dd><p>alert (BEL) </p> </dd> <dt><code class="code">\c</code></dt> <dd><p>suppress trailing new line </p> </dd> <dt><code class="code">\f</code></dt> <dd><p>form feed </p> </dd> <dt><code class="code">\n</code></dt> <dd><p>new line </p> </dd> <dt><code class="code">\r</code></dt> <dd><p>carriage return </p> </dd> <dt><code class="code">\t</code></dt> <dd><p>horizontal tab </p> </dd> <dt><code class="code">\v</code></dt> <dd><p>vertical tab </p></dd> </dl> <p>When interpreting backslash escapes, backslash followed by any other character will print that character. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="efitextmode"> <div class="nav-panel"> <p> Next: <a href="#eval" accesskey="n" rel="next">eval</a>, Previous: <a href="#echo" accesskey="p" rel="prev">echo</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="efitextmode-1"><span>17.4.26 efitextmode<a class="copiable-link" href="#efitextmode-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-efitextmode"><span class="category-def">Command: </span><span><strong class="def-name">efitextmode</strong> <var class="def-var-arguments">[min | max | <mode_num> | <cols> <rows>]</var><a class="copiable-link" href="#index-efitextmode"> ¶</a></span></dt> <dd><p>When used with no arguments displays all available text output modes. The set mode determines the columns and rows of the text display when in text mode. An asterisk, ‘<samp class="samp">*</samp>’, will be at the end of the line of the currently set mode. </p> <p>If given a single parameter, it must be ‘<samp class="samp">min</samp>’, ‘<samp class="samp">max</samp>’, or a mode number given by the listing when run with no arguments. These arguments set the mode to the minimum, maximum, and particular mode respectively. </p> <p>Otherwise, the command must be given two numerical arguments specifying the columns and rows of the desired mode. Specifying a columns and rows combination that corresponds to no supported mode, will return error, but otherwise have no effect. </p> <p>By default GRUB will start in whatever mode the EFI firmware defaults to. There are firmwares known to set up the default mode such that output behaves strangely, for example the cursor in the GRUB shell never reaches the bottom of the screen or, when typing characters at the prompt, characters from previous command output are overwritten. Setting the mode may fix this. </p> <p>The EFI specification says that mode 0 must be available and have columns and rows of 80 and 25 respectively. Mode 1 may be defined and if so must have columns and rows of 80 and 50 respectively. Any other modes may have columns and rows arbitrarily defined by the firmware. This means that a mode with columns and rows of 100 and 31 on one firmware may be a different mode number on a different firmware or not exist at all. Likewise, mode number 2 on one firmware may have a different number of columns and rows than mode 2 on a different firmware. So one should not rely on a particular mode number or a mode of a certain number of columns and rows existing on all firmwares, except for mode 0. </p> <p>Note: This command is only available on EFI platforms and is similar to EFI shell "mode" command. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="eval"> <div class="nav-panel"> <p> Next: <a href="#export" accesskey="n" rel="next">export</a>, Previous: <a href="#efitextmode" accesskey="p" rel="prev">efitextmode</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="eval-1"><span>17.4.27 eval<a class="copiable-link" href="#eval-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-eval"><span class="category-def">Command: </span><span><strong class="def-name">eval</strong> <var class="def-var-arguments">string ...</var><a class="copiable-link" href="#index-eval"> ¶</a></span></dt> <dd><p>Concatenate arguments together using single space as separator and evaluate result as sequence of GRUB commands. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="export"> <div class="nav-panel"> <p> Next: <a href="#false" accesskey="n" rel="next">false</a>, Previous: <a href="#eval" accesskey="p" rel="prev">eval</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="export-1"><span>17.4.28 export<a class="copiable-link" href="#export-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-export"><span class="category-def">Command: </span><span><strong class="def-name">export</strong> <var class="def-var-arguments">envvar</var><a class="copiable-link" href="#index-export"> ¶</a></span></dt> <dd><p>Export the environment variable <var class="var">envvar</var>. Exported variables are visible to subsidiary configuration files loaded using <code class="command">configfile</code>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="false"> <div class="nav-panel"> <p> Next: <a href="#fwsetup" accesskey="n" rel="next">fwsetup</a>, Previous: <a href="#export" accesskey="p" rel="prev">export</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="false-1"><span>17.4.29 false<a class="copiable-link" href="#false-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-false"><span class="category-def">Command: </span><span><strong class="def-name">false</strong><a class="copiable-link" href="#index-false"> ¶</a></span></dt> <dd><p>Do nothing, unsuccessfully. This is mainly useful in control constructs such as <code class="code">if</code> and <code class="code">while</code> (see <a class="pxref" href="#Shell_002dlike-scripting">Writing full configuration files directly</a>). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="fwsetup"> <div class="nav-panel"> <p> Next: <a href="#gdbinfo" accesskey="n" rel="next">gdbinfo</a>, Previous: <a href="#false" accesskey="p" rel="prev">false</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="fwsetup-1"><span>17.4.30 fwsetup<a class="copiable-link" href="#fwsetup-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-fwsetup"><span class="category-def">Command: </span><span><strong class="def-name">fwsetup</strong> <var class="def-var-arguments">[<samp class="option">--is-supported</samp>]</var><a class="copiable-link" href="#index-fwsetup"> ¶</a></span></dt> <dd><p>Reboot into the firmware setup menu. If <samp class="option">--is-supported</samp> option is specified, instead check whether the firmware supports a setup menu and exit successfully if so. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="gdbinfo"> <div class="nav-panel"> <p> Next: <a href="#gettext" accesskey="n" rel="next">gettext</a>, Previous: <a href="#fwsetup" accesskey="p" rel="prev">fwsetup</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gdbinfo-1"><span>17.4.31 gdbinfo<a class="copiable-link" href="#gdbinfo-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-gdbinfo"><span class="category-def">Command: </span><span><strong class="def-name">gdbinfo</strong><a class="copiable-link" href="#index-gdbinfo"> ¶</a></span></dt> <dd><p>Output text to be used as a GDB command for a GDB session using the gdb_grub script and attached to a running GRUB instance. The GDB command that is output will tell GDB how to load debugging symbols to their proper runtime address. Currently this is only available for EFI platforms. See the Debugging in the developer documentation for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="gettext"> <div class="nav-panel"> <p> Next: <a href="#gptsync" accesskey="n" rel="next">gptsync</a>, Previous: <a href="#gdbinfo" accesskey="p" rel="prev">gdbinfo</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gettext-1"><span>17.4.32 gettext<a class="copiable-link" href="#gettext-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-gettext"><span class="category-def">Command: </span><span><strong class="def-name">gettext</strong> <var class="def-var-arguments">string</var><a class="copiable-link" href="#index-gettext"> ¶</a></span></dt> <dd><p>Translate <var class="var">string</var> into the current language. </p> <p>The current language code is stored in the ‘<samp class="samp">lang</samp>’ variable in GRUB’s environment (see <a class="pxref" href="#lang">lang</a>). Translation files in MO format are read from ‘<samp class="samp">locale_dir</samp>’ (see <a class="pxref" href="#locale_005fdir">locale_dir</a>), usually <samp class="file">/boot/grub2/locale</samp>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="gptsync"> <div class="nav-panel"> <p> Next: <a href="#halt" accesskey="n" rel="next">halt</a>, Previous: <a href="#gettext" accesskey="p" rel="prev">gettext</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="gptsync-1"><span>17.4.33 gptsync<a class="copiable-link" href="#gptsync-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-gptsync"><span class="category-def">Command: </span><span><strong class="def-name">gptsync</strong> <var class="def-var-arguments">device [partition[+/-[type]]] …</var><a class="copiable-link" href="#index-gptsync"> ¶</a></span></dt> <dd><p>Disks using the GUID Partition Table (GPT) also have a legacy Master Boot Record (MBR) partition table for compatibility with the BIOS and with older operating systems. The legacy MBR can only represent a limited subset of GPT partition entries. </p> <p>This command populates the legacy MBR with the specified <var class="var">partition</var> entries on <var class="var">device</var>. Up to three partitions may be used. </p> <p><var class="var">type</var> is an MBR partition type code; prefix with ‘<samp class="samp">0x</samp>’ if you want to enter this in hexadecimal. The separator between <var class="var">partition</var> and <var class="var">type</var> may be ‘<samp class="samp">+</samp>’ to make the partition active, or ‘<samp class="samp">-</samp>’ to make it inactive; only one partition may be active. If both the separator and type are omitted, then the partition will be inactive. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="halt"> <div class="nav-panel"> <p> Next: <a href="#hashsum" accesskey="n" rel="next">hashsum</a>, Previous: <a href="#gptsync" accesskey="p" rel="prev">gptsync</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="halt-1"><span>17.4.34 halt<a class="copiable-link" href="#halt-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-halt"><span class="category-def">Command: </span><span><strong class="def-name">halt</strong> <var class="def-var-arguments">[<samp class="option">--no-apm</samp>]</var><a class="copiable-link" href="#index-halt"> ¶</a></span></dt> <dd><p>The command halts the computer. On the i386-pc target, the <samp class="option">--no-apm</samp> option, or short <samp class="option">-n</samp>, is specified, no APM BIOS call is performed. Otherwise, the computer is shut down using APM on that target. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="hashsum"> <div class="nav-panel"> <p> Next: <a href="#help" accesskey="n" rel="next">help</a>, Previous: <a href="#halt" accesskey="p" rel="prev">halt</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="hashsum-1"><span>17.4.35 hashsum<a class="copiable-link" href="#hashsum-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-hashsum"><span class="category-def">Command: </span><span><strong class="def-name">hashsum</strong> <var class="def-var-arguments"><samp class="option">--hash</samp> hash <samp class="option">--keep-going</samp> <samp class="option">--uncompress</samp> <samp class="option">--check</samp> file [<samp class="option">--prefix</samp> dir]|file …</var><a class="copiable-link" href="#index-hashsum"> ¶</a></span></dt> <dd><p>Compute or verify file hashes. Hash type is selected with option <samp class="option">--hash</samp>. Supported hashes are: ‘<samp class="samp">adler32</samp>’, ‘<samp class="samp">crc64</samp>’, ‘<samp class="samp">crc32</samp>’, ‘<samp class="samp">crc32rfc1510</samp>’, ‘<samp class="samp">crc24rfc2440</samp>’, ‘<samp class="samp">md4</samp>’, ‘<samp class="samp">md5</samp>’, ‘<samp class="samp">ripemd160</samp>’, ‘<samp class="samp">sha1</samp>’, ‘<samp class="samp">sha224</samp>’, ‘<samp class="samp">sha256</samp>’, ‘<samp class="samp">sha512</samp>’, ‘<samp class="samp">sha384</samp>’, ‘<samp class="samp">tiger192</samp>’, ‘<samp class="samp">tiger</samp>’, ‘<samp class="samp">tiger2</samp>’, ‘<samp class="samp">whirlpool</samp>’. Option <samp class="option">--uncompress</samp> uncompresses files before computing hash. </p> <p>When list of files is given, hash of each file is computed and printed, followed by file name, each file on a new line. </p> <p>When option <samp class="option">--check</samp> is given, it points to a file that contains list of <var class="var">hash name</var> pairs in the same format as used by UNIX <code class="command">md5sum</code> command. Option <samp class="option">--prefix</samp> may be used to give directory where files are located. Hash verification stops after the first mismatch was found unless option <samp class="option">--keep-going</samp> was given. The exit code <code class="code">$?</code> is set to 0 if hash verification is successful. If it fails, <code class="code">$?</code> is set to a nonzero value. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="help"> <div class="nav-panel"> <p> Next: <a href="#hexdump" accesskey="n" rel="next">hexdump</a>, Previous: <a href="#hashsum" accesskey="p" rel="prev">hashsum</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="help-1"><span>17.4.36 help<a class="copiable-link" href="#help-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-help"><span class="category-def">Command: </span><span><strong class="def-name">help</strong> <var class="def-var-arguments">[pattern …]</var><a class="copiable-link" href="#index-help"> ¶</a></span></dt> <dd><p>Display helpful information about builtin commands. If you do not specify <var class="var">pattern</var>, this command shows short descriptions of all available commands. </p> <p>If you specify any <var class="var">patterns</var>, it displays longer information about each of the commands whose names begin with those <var class="var">patterns</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="hexdump"> <div class="nav-panel"> <p> Next: <a href="#insmod" accesskey="n" rel="next">insmod</a>, Previous: <a href="#help" accesskey="p" rel="prev">help</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="hexdump-1"><span>17.4.37 hexdump<a class="copiable-link" href="#hexdump-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-hexdump"><span class="category-def">Command: </span><span><strong class="def-name">hexdump</strong> <var class="def-var-arguments">[–skip offset] [–length len] FILE_OR_DEVICE</var><a class="copiable-link" href="#index-hexdump"> ¶</a></span></dt> <dd><p>Show raw contents of a file or memory. When option <samp class="option">--skip</samp> is given, ‘<samp class="samp">offset</samp>’ number of bytes are skipped from the start of the device or file given. And <samp class="option">--length</samp> allows specifying a maximum number of bytes to be shown. </p> <p>If given the special device named ‘<samp class="samp">(mem)</samp>’, then the ‘<samp class="samp">offset</samp>’ given to <samp class="option">--skip</samp> is treated as the address of a memory location to dump from. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="insmod"> <div class="nav-panel"> <p> Next: <a href="#keystatus" accesskey="n" rel="next">keystatus</a>, Previous: <a href="#hexdump" accesskey="p" rel="prev">hexdump</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="insmod-1"><span>17.4.38 insmod<a class="copiable-link" href="#insmod-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-insmod"><span class="category-def">Command: </span><span><strong class="def-name">insmod</strong> <var class="def-var-arguments">module</var><a class="copiable-link" href="#index-insmod"> ¶</a></span></dt> <dd><p>Insert the dynamic GRUB module called <var class="var">module</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="keystatus"> <div class="nav-panel"> <p> Next: <a href="#list_005fcertificates" accesskey="n" rel="next">list_certificates</a>, Previous: <a href="#insmod" accesskey="p" rel="prev">insmod</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="keystatus-1"><span>17.4.39 keystatus<a class="copiable-link" href="#keystatus-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-keystatus"><span class="category-def">Command: </span><span><strong class="def-name">keystatus</strong> <var class="def-var-arguments">[<samp class="option">--shift</samp>] [<samp class="option">--ctrl</samp>] [<samp class="option">--alt</samp>]</var><a class="copiable-link" href="#index-keystatus"> ¶</a></span></dt> <dd><p>Return true if the Shift, Control, or Alt modifier keys are held down, as requested by options. This is useful in scripting, to allow some user control over behaviour without having to wait for a keypress. </p> <p>Checking key modifier status is only supported on some platforms. If invoked without any options, the <code class="command">keystatus</code> command returns true if and only if checking key modifier status is supported. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="list_005fcertificates"> <div class="nav-panel"> <p> Next: <a href="#list_005fenv" accesskey="n" rel="next">list_env</a>, Previous: <a href="#keystatus" accesskey="p" rel="prev">keystatus</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="list_005fcertificates-1"><span>17.4.40 list_certificates<a class="copiable-link" href="#list_005fcertificates-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-list_005fcertificates"><span class="category-def">Command: </span><span><strong class="def-name">list_certificates</strong><a class="copiable-link" href="#index-list_005fcertificates"> ¶</a></span></dt> <dd><p>List all x509 certificates trusted by GRUB for validating appended signatures. The output is a numbered list of certificates, showing the certificate’s serial number and Common Name. </p> <p>The certificate number can be used as an argument to <code class="command">distrust_certificate</code> (see <a class="pxref" href="#distrust_005fcertificate">distrust_certificate</a>). </p> <p>See See <a class="xref" href="#Using-appended-signatures">Using appended signatures in GRUB</a> for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="list_005fenv"> <div class="nav-panel"> <p> Next: <a href="#list_005ftrusted" accesskey="n" rel="next">list_trusted</a>, Previous: <a href="#list_005fcertificates" accesskey="p" rel="prev">list_certificates</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="list_005fenv-1"><span>17.4.41 list_env<a class="copiable-link" href="#list_005fenv-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-list_005fenv"><span class="category-def">Command: </span><span><strong class="def-name">list_env</strong> <var class="def-var-arguments">[<samp class="option">--file</samp> file]</var><a class="copiable-link" href="#index-list_005fenv"> ¶</a></span></dt> <dd><p>List all variables in the environment block file. See <a class="xref" href="#Environment-block">The GRUB environment block</a>. </p> <p>The <samp class="option">--file</samp> option overrides the default location of the environment block. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="list_005ftrusted"> <div class="nav-panel"> <p> Next: <a href="#load_005fenv" accesskey="n" rel="next">load_env</a>, Previous: <a href="#list_005fenv" accesskey="p" rel="prev">list_env</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="list_005ftrusted-1"><span>17.4.42 list_trusted<a class="copiable-link" href="#list_005ftrusted-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-list_005ftrusted"><span class="category-def">Command: </span><span><strong class="def-name">list_trusted</strong><a class="copiable-link" href="#index-list_005ftrusted"> ¶</a></span></dt> <dd><p>List all public keys trusted by GRUB for validating signatures. The output is in GPG’s v4 key fingerprint format (i.e., the output of <code class="code">gpg --fingerprint</code>). The least significant four bytes (last eight hexadecimal digits) can be used as an argument to <code class="command">distrust</code> (see <a class="pxref" href="#distrust">distrust</a>). See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information about uses for these keys. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="load_005fenv"> <div class="nav-panel"> <p> Next: <a href="#loadfont" accesskey="n" rel="next">loadfont</a>, Previous: <a href="#list_005ftrusted" accesskey="p" rel="prev">list_trusted</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="load_005fenv-1"><span>17.4.43 load_env<a class="copiable-link" href="#load_005fenv-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-load_005fenv"><span class="category-def">Command: </span><span><strong class="def-name">load_env</strong> <var class="def-var-arguments">[<samp class="option">--file</samp> file] [<samp class="option">--skip-sig</samp>] [whitelisted_variable_name] …</var><a class="copiable-link" href="#index-load_005fenv"> ¶</a></span></dt> <dd><p>Load all variables from the environment block file into the environment. See <a class="xref" href="#Environment-block">The GRUB environment block</a>. </p> <p>The <samp class="option">--file</samp> option overrides the default location of the environment block. </p> <p>The <samp class="option">--skip-sig</samp> option skips signature checking even when the value of environment variable <code class="code">check_signatures</code> is set to <code class="code">enforce</code> (see <a class="pxref" href="#check_005fsignatures">check_signatures</a>). </p> <p>If one or more variable names are provided as arguments, they are interpreted as a whitelist of variables to load from the environment block file. Variables set in the file but not present in the whitelist are ignored. </p> <p>The <samp class="option">--skip-sig</samp> option should be used with care, and should always be used in concert with a whitelist of acceptable variables whose values should be set. Failure to employ a carefully constructed whitelist could result in reading a malicious value into critical environment variables from the file, such as setting <code class="code">check_signatures=no</code>, modifying <code class="code">prefix</code> to boot from an unexpected location or not at all, etc. </p> <p>When used with care, <samp class="option">--skip-sig</samp> and the whitelist enable an administrator to configure a system to boot only signed configurations, but to allow the user to select from among multiple configurations, and to enable “one-shot” boot attempts and “savedefault” behavior. See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information. </p> <p>Extra care should be taken when combining this command with appended signatures (see <a class="pxref" href="#Using-appended-signatures">Using appended signatures in GRUB</a>), as this file is not validated by an appended signature and could set <code class="code">check_appended_signatures=no</code> if GRUB is not in see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a> mode. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="loadfont"> <div class="nav-panel"> <p> Next: <a href="#loopback" accesskey="n" rel="next">loopback</a>, Previous: <a href="#load_005fenv" accesskey="p" rel="prev">load_env</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="loadfont-1"><span>17.4.44 loadfont<a class="copiable-link" href="#loadfont-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-loadfont"><span class="category-def">Command: </span><span><strong class="def-name">loadfont</strong> <var class="def-var-arguments">file …</var><a class="copiable-link" href="#index-loadfont"> ¶</a></span></dt> <dd><p>Load specified font files. Unless absolute pathname is given, <var class="var">file</var> is assumed to be in directory ‘<samp class="samp">$prefix/fonts</samp>’ with suffix ‘<samp class="samp">.pf2</samp>’ appended. See <a class="xref" href="#Theme-file-format">Fonts</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="loopback"> <div class="nav-panel"> <p> Next: <a href="#ls" accesskey="n" rel="next">ls</a>, Previous: <a href="#loadfont" accesskey="p" rel="prev">loadfont</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="loopback-1"><span>17.4.45 loopback<a class="copiable-link" href="#loopback-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-loopback"><span class="category-def">Command: </span><span><strong class="def-name">loopback</strong> <var class="def-var-arguments">[<samp class="option">-d</samp>] [<samp class="option">-D</samp>] device file</var><a class="copiable-link" href="#index-loopback"> ¶</a></span></dt> <dd><p>Make the device named <var class="var">device</var> correspond to the contents of the filesystem image in <var class="var">file</var>. For example: </p> <div class="example"> <pre class="example-preformatted">loopback loop0 /path/to/image ls (loop0)/ </pre></div> <p>Specifying the <samp class="option">-D</samp> option allows the loopback file to be tranparently decompressed if there is an appropriate decompressor loaded. </p> <p>With the <samp class="option">-d</samp> option, delete a device previously created using this command. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="ls"> <div class="nav-panel"> <p> Next: <a href="#lsfonts" accesskey="n" rel="next">lsfonts</a>, Previous: <a href="#loopback" accesskey="p" rel="prev">loopback</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="ls-1"><span>17.4.46 ls<a class="copiable-link" href="#ls-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-ls"><span class="category-def">Command: </span><span><strong class="def-name">ls</strong> <var class="def-var-arguments">[arg …]</var><a class="copiable-link" href="#index-ls"> ¶</a></span></dt> <dd><p>List devices or files. </p> <p>With no arguments, print all devices known to GRUB. </p> <p>If the argument is a device name enclosed in parentheses (see <a class="pxref" href="#Device-syntax">How to specify devices</a>), then print the name of the filesystem of that device. </p> <p>If the argument is a directory given as an absolute file name (see <a class="pxref" href="#File-name-syntax">How to specify files</a>), then list the contents of that directory. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="lsfonts"> <div class="nav-panel"> <p> Next: <a href="#lsmod" accesskey="n" rel="next">lsmod</a>, Previous: <a href="#ls" accesskey="p" rel="prev">ls</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="lsfonts-1"><span>17.4.47 lsfonts<a class="copiable-link" href="#lsfonts-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-lsfonts"><span class="category-def">Command: </span><span><strong class="def-name">lsfonts</strong><a class="copiable-link" href="#index-lsfonts"> ¶</a></span></dt> <dd><p>List loaded fonts. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="lsmod"> <div class="nav-panel"> <p> Next: <a href="#md5sum" accesskey="n" rel="next">md5sum</a>, Previous: <a href="#lsfonts" accesskey="p" rel="prev">lsfonts</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="lsmod-1"><span>17.4.48 lsmod<a class="copiable-link" href="#lsmod-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-lsmod"><span class="category-def">Command: </span><span><strong class="def-name">lsmod</strong><a class="copiable-link" href="#index-lsmod"> ¶</a></span></dt> <dd><p>Show list of loaded modules. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="md5sum"> <div class="nav-panel"> <p> Next: <a href="#module" accesskey="n" rel="next">module</a>, Previous: <a href="#lsmod" accesskey="p" rel="prev">lsmod</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="md5sum-1"><span>17.4.49 md5sum<a class="copiable-link" href="#md5sum-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-md5sum"><span class="category-def">Command: </span><span><strong class="def-name">md5sum</strong> <var class="def-var-arguments">arg …</var><a class="copiable-link" href="#index-md5sum"> ¶</a></span></dt> <dd><p>Alias for <code class="code">hashsum --hash md5 arg …</code>. See command <code class="command">hashsum</code> (see <a class="pxref" href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="module"> <div class="nav-panel"> <p> Next: <a href="#multiboot" accesskey="n" rel="next">multiboot</a>, Previous: <a href="#md5sum" accesskey="p" rel="prev">md5sum</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="module-1"><span>17.4.50 module<a class="copiable-link" href="#module-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-module"><span class="category-def">Command: </span><span><strong class="def-name">module</strong> <var class="def-var-arguments">[–nounzip] file [arguments]</var><a class="copiable-link" href="#index-module"> ¶</a></span></dt> <dd><p>Load a module for multiboot kernel image. The rest of the line is passed verbatim as the module command line. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="multiboot"> <div class="nav-panel"> <p> Next: <a href="#nativedisk" accesskey="n" rel="next">nativedisk</a>, Previous: <a href="#module" accesskey="p" rel="prev">module</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="multiboot-1"><span>17.4.51 multiboot<a class="copiable-link" href="#multiboot-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-multiboot"><span class="category-def">Command: </span><span><strong class="def-name">multiboot</strong> <var class="def-var-arguments">[–quirk-bad-kludge] [–quirk-modules-after-kernel] file …</var><a class="copiable-link" href="#index-multiboot"> ¶</a></span></dt> <dd><p>Load a multiboot kernel image from <var class="var">file</var>. The rest of the line is passed verbatim as the <em class="dfn">kernel command-line</em>. Any module must be reloaded after using this command (see <a class="pxref" href="#module">module</a>). </p> <p>Some kernels have known problems. You need to specify –quirk-* for those. –quirk-bad-kludge is a problem seen in several products that they include loading kludge information with invalid data in ELF file. GRUB prior to 0.97 and some custom builds preferred ELF information while 0.97 and GRUB 2 use kludge. Use this option to ignore kludge. Known affected systems: old Solaris, SkyOS. </p> <p>–quirk-modules-after-kernel is needed for kernels which load at relatively high address e.g. 16MiB mark and can’t cope with modules stuffed between 1MiB mark and beginning of the kernel. Known afftected systems: VMWare. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="nativedisk"> <div class="nav-panel"> <p> Next: <a href="#normal" accesskey="n" rel="next">normal</a>, Previous: <a href="#multiboot" accesskey="p" rel="prev">multiboot</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="nativedisk-1"><span>17.4.52 nativedisk<a class="copiable-link" href="#nativedisk-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-nativedisk"><span class="category-def">Command: </span><span><strong class="def-name">nativedisk</strong><a class="copiable-link" href="#index-nativedisk"> ¶</a></span></dt> <dd><p>Switch from firmware disk drivers to native ones. Really useful only on platforms where both firmware and native disk drives are available. Currently i386-pc, i386-efi, i386-ieee1275 and x86_64-efi. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="normal"> <div class="nav-panel"> <p> Next: <a href="#normal_005fexit" accesskey="n" rel="next">normal_exit</a>, Previous: <a href="#nativedisk" accesskey="p" rel="prev">nativedisk</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="normal-1"><span>17.4.53 normal<a class="copiable-link" href="#normal-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-normal"><span class="category-def">Command: </span><span><strong class="def-name">normal</strong> <var class="def-var-arguments">[file]</var><a class="copiable-link" href="#index-normal"> ¶</a></span></dt> <dd><p>Enter normal mode and display the GRUB menu. </p> <p>In normal mode, commands, filesystem modules, and cryptography modules are automatically loaded, and the full GRUB script parser is available. Other modules may be explicitly loaded using <code class="command">insmod</code> (see <a class="pxref" href="#insmod">insmod</a>). </p> <p>If a <var class="var">file</var> is given, then commands will be read from that file. Otherwise, they will be read from <samp class="file">$prefix/grub.cfg</samp> if it exists. </p> <p><code class="command">normal</code> may be called from within normal mode, creating a nested environment. It is more usual to use <code class="command">configfile</code> (see <a class="pxref" href="#configfile">configfile</a>) for this. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="normal_005fexit"> <div class="nav-panel"> <p> Next: <a href="#parttool" accesskey="n" rel="next">parttool</a>, Previous: <a href="#normal" accesskey="p" rel="prev">normal</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="normal_005fexit-1"><span>17.4.54 normal_exit<a class="copiable-link" href="#normal_005fexit-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-normal_005fexit"><span class="category-def">Command: </span><span><strong class="def-name">normal_exit</strong><a class="copiable-link" href="#index-normal_005fexit"> ¶</a></span></dt> <dd><p>Exit normal mode (see <a class="pxref" href="#normal">normal</a>). If this instance of normal mode was not nested within another one, then return to rescue mode. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="parttool"> <div class="nav-panel"> <p> Next: <a href="#password" accesskey="n" rel="next">password</a>, Previous: <a href="#normal_005fexit" accesskey="p" rel="prev">normal_exit</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="parttool-1"><span>17.4.55 parttool<a class="copiable-link" href="#parttool-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-parttool"><span class="category-def">Command: </span><span><strong class="def-name">parttool</strong> <var class="def-var-arguments">partition commands</var><a class="copiable-link" href="#index-parttool"> ¶</a></span></dt> <dd><p>Make various modifications to partition table entries. </p> <p>Each <var class="var">command</var> is either a boolean option, in which case it must be followed with ‘<samp class="samp">+</samp>’ or ‘<samp class="samp">-</samp>’ (with no intervening space) to enable or disable that option, or else it takes a value in the form ‘<samp class="samp"><var class="var">command</var>=<var class="var">value</var></samp>’. </p> <p>Currently, <code class="command">parttool</code> is only useful on DOS partition tables (also known as Master Boot Record, or MBR). On these partition tables, the following commands are available: </p> <dl class="table"> <dt>‘<samp class="samp">boot</samp>’ (boolean)</dt> <dd><p>When enabled, this makes the selected partition be the active (bootable) partition on its disk, clearing the active flag on all other partitions. This command is limited to <em class="emph">primary</em> partitions. </p> </dd> <dt>‘<samp class="samp">type</samp>’ (value)</dt> <dd><p>Change the type of an existing partition. The value must be a number in the range 0-0xFF (prefix with ‘<samp class="samp">0x</samp>’ to enter it in hexadecimal). </p> </dd> <dt>‘<samp class="samp">hidden</samp>’ (boolean)</dt> <dd><p>When enabled, this hides the selected partition by setting the <em class="dfn">hidden</em> bit in its partition type code; when disabled, unhides the selected partition by clearing this bit. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk. See also <a class="ref" href="#DOS_002fWindows">DOS/Windows</a>. </p></dd> </dl> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="password"> <div class="nav-panel"> <p> Next: <a href="#password_005fpbkdf2" accesskey="n" rel="next">password_pbkdf2</a>, Previous: <a href="#parttool" accesskey="p" rel="prev">parttool</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="password-1"><span>17.4.56 password<a class="copiable-link" href="#password-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-password"><span class="category-def">Command: </span><span><strong class="def-name">password</strong> <var class="def-var-arguments">user clear-password</var><a class="copiable-link" href="#index-password"> ¶</a></span></dt> <dd><p>Define a user named <var class="var">user</var> with password <var class="var">clear-password</var>. See <a class="xref" href="#Security">Security</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="password_005fpbkdf2"> <div class="nav-panel"> <p> Next: <a href="#plainmount" accesskey="n" rel="next">plainmount</a>, Previous: <a href="#password" accesskey="p" rel="prev">password</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="password_005fpbkdf2-1"><span>17.4.57 password_pbkdf2<a class="copiable-link" href="#password_005fpbkdf2-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-password_005fpbkdf2"><span class="category-def">Command: </span><span><strong class="def-name">password_pbkdf2</strong> <var class="def-var-arguments">user hashed-password</var><a class="copiable-link" href="#index-password_005fpbkdf2"> ¶</a></span></dt> <dd><p>Define a user named <var class="var">user</var> with password hash <var class="var">hashed-password</var>. Use <code class="command">grub2-mkpasswd-pbkdf2</code> (see <a class="pxref" href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>) to generate password hashes. See <a class="xref" href="#Security">Security</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="plainmount"> <div class="nav-panel"> <p> Next: <a href="#play" accesskey="n" rel="next">play</a>, Previous: <a href="#password_005fpbkdf2" accesskey="p" rel="prev">password_pbkdf2</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="plainmount-1"><span>17.4.58 plainmount<a class="copiable-link" href="#plainmount-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-plainmount"><span class="category-def">Command: </span><span><strong class="def-name">plainmount</strong> <var class="def-var-arguments">device <samp class="option">-c</samp> cipher <samp class="option">-s</samp> key size [<samp class="option">-h</samp> hash]</var><a class="copiable-link" href="#index-plainmount"> ¶</a></span></dt> <dd><p>[<samp class="option">-S</samp> sector size] [<samp class="option">-p</samp> password] [<samp class="option">-u</samp> uuid] [[<samp class="option">-d</samp> keyfile] [<samp class="option">-O</samp> keyfile offset]] </p> <p>Setup access to the encrypted device in plain mode. Offset of the encrypted data at the device is specified in terms of 512 byte sectors using the blocklist syntax and loopback device. The following example shows how to specify 1MiB offset: </p> <div class="example"> <pre class="example-preformatted">loopback node (hd0,gpt1)2048+ plainmount node <var class="var">...</var> </pre></div> <p>The <code class="command">plainmount</code> command can be used to open LUKS encrypted volume if its master key and parameters (key size, cipher, offset, etc) are known. </p> <p>There are two ways to specify a password: a keyfile and a secret passphrase. The keyfile path parameter has higher priority than the secret passphrase parameter and is specified with the option <samp class="option">-d</samp>. Password data obtained from keyfiles is not hashed and is used directly as a cipher key. An optional offset of password data in the keyfile can be specified with the option <samp class="option">-O</samp> or directly with the option <samp class="option">-d</samp> and GRUB blocklist syntax, if the keyfile data can be accessed from a device and is 512 byte aligned. The following example shows both methods to specify password data in the keyfile at offset 1MiB: </p> <div class="example"> <pre class="example-preformatted">plainmount -d (hd0,gpt1)2048+ <var class="var">...</var> plainmount -d (hd0,gpt1)+ -O 1048576 <var class="var">...</var> </pre></div> <p>If no keyfile is specified then the password is set to the string specified by option <samp class="option">-p</samp> or is requested interactively from the console. In both cases the provided password is hashed with the algorithm specified by the option <samp class="option">-h</samp>. This option is mandatory if no keyfile is specified, but it can be set to ‘<samp class="samp">plain</samp>’ which means that no hashing is done and such password is used directly as a key. </p> <p>Cipher <samp class="option">-c</samp> and keysize <samp class="option">-s</samp> options specify the cipher algorithm and the key size respectively and are mandatory options. Cipher must be specified with the mode separated by a dash (for example, ‘<samp class="samp">aes-xts-plain64</samp>’). Key size option <samp class="option">-s</samp> is the key size of the cipher in bits, not to be confused with the offset of the key data in a keyfile specified with the <samp class="option">-O</samp> option. It must not exceed 1024 bits, so a 32 byte key would be specified as 256 bits </p> <p>The optional parameter <samp class="option">-S</samp> specifies encrypted device sector size. It must be at least 512 bytes long (default value) and a power of 2. <a class="footnote" id="DOCF9" href="#FOOT9"><sup>9</sup></a>. Disk sector size is configured when creating the encrypted volume. Attempting to decrypt volumes with a different sector size than it was created with will not result in an error, but will decrypt to random bytes and thus prevent accessing the volume (in some cases the filesystem driver can detect the presence of a filesystem, but nevertheless will refuse to mount it). </p> <p>By default new plainmount devices will be given a UUID starting with ’109fea84-a6b7-34a8-4bd1-1c506305a401’ where the last digits are incremented by one for each plainmounted device beyond the first up to 2^10 devices. </p> <p>All encryption arguments (cipher, hash, key size, disk offset and disk sector size) must match the parameters used to create the volume. If any of them does not match the actual arguments used during the initial encryption, plainmount will create virtual device with the garbage data and GRUB will report unknown filesystem for such device. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="play"> <div class="nav-panel"> <p> Next: <a href="#probe" accesskey="n" rel="next">probe</a>, Previous: <a href="#plainmount" accesskey="p" rel="prev">plainmount</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="play-1"><span>17.4.59 play<a class="copiable-link" href="#play-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-play"><span class="category-def">Command: </span><span><strong class="def-name">play</strong> <var class="def-var-arguments">file | tempo [pitch1 duration1] [pitch2 duration2] …</var><a class="copiable-link" href="#index-play"> ¶</a></span></dt> <dd><p>Plays a tune </p> <p>If the argument is a file name (see <a class="pxref" href="#File-name-syntax">How to specify files</a>), play the tune recorded in it. The file format is first the tempo as an unsigned 32bit little-endian number, then pairs of unsigned 16bit little-endian numbers for pitch and duration pairs. </p> <p>If the arguments are a series of numbers, play the inline tune. </p> <p>The tempo is the base for all note durations. 60 gives a 1-second base, 120 gives a half-second base, etc. Pitches are Hz. Set pitch to 0 to produce a rest. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="probe"> <div class="nav-panel"> <p> Next: <a href="#rdmsr" accesskey="n" rel="next">rdmsr</a>, Previous: <a href="#play" accesskey="p" rel="prev">play</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="probe-1"><span>17.4.60 probe<a class="copiable-link" href="#probe-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-probe"><span class="category-def">Command: </span><span><strong class="def-name">probe</strong> <var class="def-var-arguments">[<samp class="option">--set</samp> var] <samp class="option">--driver</samp>|<samp class="option">--partmap</samp>|<samp class="option">--fs</samp>|<samp class="option">--fs-uuid</samp>|<samp class="option">--label</samp>|<samp class="option">--part-uuid</samp> device</var><a class="copiable-link" href="#index-probe"> ¶</a></span></dt> <dd><p>Retrieve device information. If option <samp class="option">--set</samp> is given, assign result to variable <var class="var">var</var>, otherwise print information on the screen. </p> <p>The option <samp class="option">--part-uuid</samp> is currently only implemented for MSDOS and GPT formatted disks. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="rdmsr"> <div class="nav-panel"> <p> Next: <a href="#read" accesskey="n" rel="next">read</a>, Previous: <a href="#probe" accesskey="p" rel="prev">probe</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="rdmsr-1"><span>17.4.61 rdmsr<a class="copiable-link" href="#rdmsr-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-rdmsr"><span class="category-def">Command:: </span><span><strong class="def-name">rdmsr</strong> <var class="def-var-arguments">0xADDR [-v VARNAME]</var><a class="copiable-link" href="#index-rdmsr"> ¶</a></span></dt> <dd><p>Read a model-specific register at address 0xADDR. If the parameter <samp class="option">-v</samp> is used and an environment variable <var class="var">VARNAME</var> is given, set that environment variable to the value that was read. </p> <p>Please note that on SMP systems, reading from a MSR that has a scope per hardware thread, implies that the value that is returned only applies to the particular cpu/core/thread that runs the command. </p> <p>Also, if you specify a reserved or unimplemented MSR address, it will cause a general protection exception (which is not currently being handled) and the system will reboot. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="read"> <div class="nav-panel"> <p> Next: <a href="#reboot" accesskey="n" rel="next">reboot</a>, Previous: <a href="#rdmsr" accesskey="p" rel="prev">rdmsr</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="read-1"><span>17.4.62 read<a class="copiable-link" href="#read-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-read"><span class="category-def">Command: </span><span><strong class="def-name">read</strong> <var class="def-var-arguments">[-s] [var]</var><a class="copiable-link" href="#index-read"> ¶</a></span></dt> <dd><p>Read a line of input from the user. If an environment variable <var class="var">var</var> is given, set that environment variable to the line of input that was read, with no terminating newline. If the parameter <samp class="option">-s</samp> is used, enable silent mode where input is not printed to the terminal. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="reboot"> <div class="nav-panel"> <p> Next: <a href="#regexp" accesskey="n" rel="next">regexp</a>, Previous: <a href="#read" accesskey="p" rel="prev">read</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="reboot-1"><span>17.4.63 reboot<a class="copiable-link" href="#reboot-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-reboot"><span class="category-def">Command: </span><span><strong class="def-name">reboot</strong><a class="copiable-link" href="#index-reboot"> ¶</a></span></dt> <dd><p>Reboot the computer. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="regexp"> <div class="nav-panel"> <p> Next: <a href="#rmmod" accesskey="n" rel="next">rmmod</a>, Previous: <a href="#reboot" accesskey="p" rel="prev">reboot</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="regexp-1"><span>17.4.64 regexp<a class="copiable-link" href="#regexp-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-regexp"><span class="category-def">Command: </span><span><strong class="def-name">regexp</strong> <var class="def-var-arguments">[<samp class="option">--set</samp> [number:]var] regexp string</var><a class="copiable-link" href="#index-regexp"> ¶</a></span></dt> <dd><p>Test if regular expression <var class="var">regexp</var> matches <var class="var">string</var>. Supported regular expressions are POSIX.2 Extended Regular Expressions. If option <samp class="option">--set</samp> is given, store <var class="var">number</var>th matched subexpression in variable <var class="var">var</var>. Subexpressions are numbered in order of their opening parentheses starting from ‘<samp class="samp">1</samp>’. <var class="var">number</var> defaults to ‘<samp class="samp">1</samp>’. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="rmmod"> <div class="nav-panel"> <p> Next: <a href="#save_005fenv" accesskey="n" rel="next">save_env</a>, Previous: <a href="#regexp" accesskey="p" rel="prev">regexp</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="rmmod-1"><span>17.4.65 rmmod<a class="copiable-link" href="#rmmod-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-rmmod"><span class="category-def">Command: </span><span><strong class="def-name">rmmod</strong> <var class="def-var-arguments">module</var><a class="copiable-link" href="#index-rmmod"> ¶</a></span></dt> <dd><p>Remove a loaded <var class="var">module</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="save_005fenv"> <div class="nav-panel"> <p> Next: <a href="#search" accesskey="n" rel="next">search</a>, Previous: <a href="#rmmod" accesskey="p" rel="prev">rmmod</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="save_005fenv-1"><span>17.4.66 save_env<a class="copiable-link" href="#save_005fenv-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-save_005fenv"><span class="category-def">Command: </span><span><strong class="def-name">save_env</strong> <var class="def-var-arguments">[<samp class="option">--file</samp> file] var …</var><a class="copiable-link" href="#index-save_005fenv"> ¶</a></span></dt> <dd><p>Save the named variables from the environment to the environment block file. See <a class="xref" href="#Environment-block">The GRUB environment block</a>. </p> <p>The <samp class="option">--file</samp> option overrides the default location of the environment block. </p> <p>This command will operate successfully even when environment variable <code class="code">check_signatures</code> is set to <code class="code">enforce</code> (see <a class="pxref" href="#check_005fsignatures">check_signatures</a>), since it writes to disk and does not alter the behavior of GRUB based on any contents of disk that have been read. It is possible to modify a digitally signed environment block file from within GRUB using this command, such that its signature will no longer be valid on subsequent boots. Care should be taken in such advanced configurations to avoid rendering the system unbootable. See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="search"> <div class="nav-panel"> <p> Next: <a href="#sendkey" accesskey="n" rel="next">sendkey</a>, Previous: <a href="#save_005fenv" accesskey="p" rel="prev">save_env</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="search-1"><span>17.4.67 search<a class="copiable-link" href="#search-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-search"><span class="category-def">Command: </span><span><strong class="def-name">search</strong> <var class="def-var-arguments">[<samp class="option">--file</samp>|<samp class="option">--label</samp>|<samp class="option">--fs-uuid</samp>] [<samp class="option">--set</samp> [var]] [<samp class="option">--no-floppy</samp>|<samp class="option">--efidisk-only</samp>] name</var><a class="copiable-link" href="#index-search"> ¶</a></span></dt> <dd><p>Search devices by file (<samp class="option">-f</samp>, <samp class="option">--file</samp>), filesystem label (<samp class="option">-l</samp>, <samp class="option">--label</samp>), or filesystem UUID (<samp class="option">-u</samp>, <samp class="option">--fs-uuid</samp>). </p> <p>If the (<samp class="option">-s</samp>, <samp class="option">--set</samp>) option is used, the first device found is set as the value of environment variable <var class="var">var</var>. The default variable is ‘<samp class="samp">root</samp>’. </p> <p>The (<samp class="option">-n</samp>, <samp class="option">--no-floppy</samp>) option prevents searching floppy devices, which can be slow. </p> <p>The (<samp class="option">--efidisk-only</samp>) option prevents searching any other devices then EFI disks. This is typically used when chainloading to local EFI partition. </p> <p>The ‘<samp class="samp">search.file</samp>’, ‘<samp class="samp">search.fs_label</samp>’, and ‘<samp class="samp">search.fs_uuid</samp>’ commands are aliases for ‘<samp class="samp">search --file</samp>’, ‘<samp class="samp">search --label</samp>’, and ‘<samp class="samp">search --fs-uuid</samp>’ respectively. </p> <p>Also hints as to which device may be the most likely to contain the item searched for may be given via the (<samp class="option">-h</samp>, <samp class="option">--hint</samp>) option with a device name as an argument. If the argument ends with a comma, then partitions on the device are also searched. Furthermore, platform specific hints may be given via the options <samp class="option">--hint-ieee1275</samp>, <samp class="option">--hint-bios</samp>, <samp class="option">--hint-baremetal</samp>, <samp class="option">--hint-efi</samp>, and <samp class="option">--hint-arc</samp>. When specified, these options take an argument and operate like <samp class="option">--hint</samp>, but only on the specified platform. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="sendkey"> <div class="nav-panel"> <p> Next: <a href="#set" accesskey="n" rel="next">set</a>, Previous: <a href="#search" accesskey="p" rel="prev">search</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="sendkey-1"><span>17.4.68 sendkey<a class="copiable-link" href="#sendkey-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-sendkey"><span class="category-def">Command: </span><span><strong class="def-name">sendkey</strong> <var class="def-var-arguments">[<samp class="option">--num</samp>|<samp class="option">--caps</samp>|<samp class="option">--scroll</samp>|<samp class="option">--insert</samp>|<samp class="option">--pause</samp>|<samp class="option">--left-shift</samp>|<samp class="option">--right-shift</samp>|<samp class="option">--sysrq</samp>|<samp class="option">--numkey</samp>|<samp class="option">--capskey</samp>|<samp class="option">--scrollkey</samp>|<samp class="option">--insertkey</samp>|<samp class="option">--left-alt</samp>|<samp class="option">--right-alt</samp>|<samp class="option">--left-ctrl</samp>|<samp class="option">--right-ctrl</samp> ‘<samp class="samp">on</samp>’|‘<samp class="samp">off</samp>’]… [<samp class="option">no-led</samp>] keystroke</var><a class="copiable-link" href="#index-sendkey"> ¶</a></span></dt> <dd><p>Insert keystrokes into the keyboard buffer when booting. Sometimes an operating system or chainloaded boot loader requires particular keys to be pressed: for example, one might need to press a particular key to enter "safe mode", or when chainloading another boot loader one might send keystrokes to it to navigate its menu. </p> <p>Note: This command is currently only available on the i386-pc target. </p> <p>You may provide up to 16 keystrokes (the length of the BIOS keyboard buffer). Keystroke names may be upper-case or lower-case letters, digits, or taken from the following table: </p> <table class="multitable"> <thead><tr><th width="40%">Name</th><th width="50%">Key</th></tr></thead> <tbody><tr><td width="40%">escape</td><td width="50%">Escape</td></tr> <tr><td width="40%">exclam</td><td width="50%">!</td></tr> <tr><td width="40%">at</td><td width="50%">@</td></tr> <tr><td width="40%">numbersign</td><td width="50%">#</td></tr> <tr><td width="40%">dollar</td><td width="50%">$</td></tr> <tr><td width="40%">percent</td><td width="50%">%</td></tr> <tr><td width="40%">caret</td><td width="50%">^</td></tr> <tr><td width="40%">ampersand</td><td width="50%">&</td></tr> <tr><td width="40%">asterisk</td><td width="50%">*</td></tr> <tr><td width="40%">parenleft</td><td width="50%">(</td></tr> <tr><td width="40%">parenright</td><td width="50%">)</td></tr> <tr><td width="40%">minus</td><td width="50%">-</td></tr> <tr><td width="40%">underscore</td><td width="50%">_</td></tr> <tr><td width="40%">equal</td><td width="50%">=</td></tr> <tr><td width="40%">plus</td><td width="50%">+</td></tr> <tr><td width="40%">backspace</td><td width="50%">Backspace</td></tr> <tr><td width="40%">tab</td><td width="50%">Tab</td></tr> <tr><td width="40%">bracketleft</td><td width="50%">[</td></tr> <tr><td width="40%">braceleft</td><td width="50%">{</td></tr> <tr><td width="40%">bracketright</td><td width="50%">]</td></tr> <tr><td width="40%">braceright</td><td width="50%">}</td></tr> <tr><td width="40%">enter</td><td width="50%">Enter</td></tr> <tr><td width="40%">control</td><td width="50%">press and release Control</td></tr> <tr><td width="40%">semicolon</td><td width="50%">;</td></tr> <tr><td width="40%">colon</td><td width="50%">:</td></tr> <tr><td width="40%">quote</td><td width="50%">’</td></tr> <tr><td width="40%">doublequote</td><td width="50%">"</td></tr> <tr><td width="40%">backquote</td><td width="50%">‘</td></tr> <tr><td width="40%">tilde</td><td width="50%">~</td></tr> <tr><td width="40%">shift</td><td width="50%">press and release left Shift</td></tr> <tr><td width="40%">backslash</td><td width="50%">\</td></tr> <tr><td width="40%">bar</td><td width="50%">|</td></tr> <tr><td width="40%">comma</td><td width="50%">,</td></tr> <tr><td width="40%">less</td><td width="50%"><</td></tr> <tr><td width="40%">period</td><td width="50%">.</td></tr> <tr><td width="40%">greater</td><td width="50%">></td></tr> <tr><td width="40%">slash</td><td width="50%">/</td></tr> <tr><td width="40%">question</td><td width="50%">?</td></tr> <tr><td width="40%">rshift</td><td width="50%">press and release right Shift</td></tr> <tr><td width="40%">alt</td><td width="50%">press and release Alt</td></tr> <tr><td width="40%">space</td><td width="50%">space bar</td></tr> <tr><td width="40%">capslock</td><td width="50%">Caps Lock</td></tr> <tr><td width="40%">F1</td><td width="50%">F1</td></tr> <tr><td width="40%">F2</td><td width="50%">F2</td></tr> <tr><td width="40%">F3</td><td width="50%">F3</td></tr> <tr><td width="40%">F4</td><td width="50%">F4</td></tr> <tr><td width="40%">F5</td><td width="50%">F5</td></tr> <tr><td width="40%">F6</td><td width="50%">F6</td></tr> <tr><td width="40%">F7</td><td width="50%">F7</td></tr> <tr><td width="40%">F8</td><td width="50%">F8</td></tr> <tr><td width="40%">F9</td><td width="50%">F9</td></tr> <tr><td width="40%">F10</td><td width="50%">F10</td></tr> <tr><td width="40%">F11</td><td width="50%">F11</td></tr> <tr><td width="40%">F12</td><td width="50%">F12</td></tr> <tr><td width="40%">num1</td><td width="50%">1 (numeric keypad)</td></tr> <tr><td width="40%">num2</td><td width="50%">2 (numeric keypad)</td></tr> <tr><td width="40%">num3</td><td width="50%">3 (numeric keypad)</td></tr> <tr><td width="40%">num4</td><td width="50%">4 (numeric keypad)</td></tr> <tr><td width="40%">num5</td><td width="50%">5 (numeric keypad)</td></tr> <tr><td width="40%">num6</td><td width="50%">6 (numeric keypad)</td></tr> <tr><td width="40%">num7</td><td width="50%">7 (numeric keypad)</td></tr> <tr><td width="40%">num8</td><td width="50%">8 (numeric keypad)</td></tr> <tr><td width="40%">num9</td><td width="50%">9 (numeric keypad)</td></tr> <tr><td width="40%">num0</td><td width="50%">0 (numeric keypad)</td></tr> <tr><td width="40%">numperiod</td><td width="50%">. (numeric keypad)</td></tr> <tr><td width="40%">numend</td><td width="50%">End (numeric keypad)</td></tr> <tr><td width="40%">numdown</td><td width="50%">Down (numeric keypad)</td></tr> <tr><td width="40%">numpgdown</td><td width="50%">Page Down (numeric keypad)</td></tr> <tr><td width="40%">numleft</td><td width="50%">Left (numeric keypad)</td></tr> <tr><td width="40%">numcenter</td><td width="50%">5 with Num Lock inactive (numeric keypad)</td></tr> <tr><td width="40%">numright</td><td width="50%">Right (numeric keypad)</td></tr> <tr><td width="40%">numhome</td><td width="50%">Home (numeric keypad)</td></tr> <tr><td width="40%">numup</td><td width="50%">Up (numeric keypad)</td></tr> <tr><td width="40%">numpgup</td><td width="50%">Page Up (numeric keypad)</td></tr> <tr><td width="40%">numinsert</td><td width="50%">Insert (numeric keypad)</td></tr> <tr><td width="40%">numdelete</td><td width="50%">Delete (numeric keypad)</td></tr> <tr><td width="40%">numasterisk</td><td width="50%">* (numeric keypad)</td></tr> <tr><td width="40%">numminus</td><td width="50%">- (numeric keypad)</td></tr> <tr><td width="40%">numplus</td><td width="50%">+ (numeric keypad)</td></tr> <tr><td width="40%">numslash</td><td width="50%">/ (numeric keypad)</td></tr> <tr><td width="40%">numenter</td><td width="50%">Enter (numeric keypad)</td></tr> <tr><td width="40%">delete</td><td width="50%">Delete</td></tr> <tr><td width="40%">insert</td><td width="50%">Insert</td></tr> <tr><td width="40%">home</td><td width="50%">Home</td></tr> <tr><td width="40%">end</td><td width="50%">End</td></tr> <tr><td width="40%">pgdown</td><td width="50%">Page Down</td></tr> <tr><td width="40%">pgup</td><td width="50%">Page Up</td></tr> <tr><td width="40%">down</td><td width="50%">Down</td></tr> <tr><td width="40%">up</td><td width="50%">Up</td></tr> <tr><td width="40%">left</td><td width="50%">Left</td></tr> <tr><td width="40%">right</td><td width="50%">Right</td></tr> </tbody> </table> <p>As well as keystrokes, the <code class="command">sendkey</code> command takes various options that affect the BIOS keyboard status flags. These options take an ‘<samp class="samp">on</samp>’ or ‘<samp class="samp">off</samp>’ parameter, specifying that the corresponding status flag be set or unset; omitting the option for a given status flag will leave that flag at its initial state at boot. The <samp class="option">--num</samp>, <samp class="option">--caps</samp>, <samp class="option">--scroll</samp>, and <samp class="option">--insert</samp> options emulate setting the corresponding mode, while the <samp class="option">--numkey</samp>, <samp class="option">--capskey</samp>, <samp class="option">--scrollkey</samp>, and <samp class="option">--insertkey</samp> options emulate pressing and holding the corresponding key. The other status flag options are self-explanatory. </p> <p>If the <samp class="option">--no-led</samp> option is given, the status flag options will have no effect on keyboard LEDs. </p> <p>If the <code class="command">sendkey</code> command is given multiple times, then only the last invocation has any effect. </p> <p>Since <code class="command">sendkey</code> manipulates the BIOS keyboard buffer, it may cause hangs, reboots, or other misbehaviour on some systems. If the operating system or boot loader that runs after GRUB uses its own keyboard driver rather than the BIOS keyboard functions, then <code class="command">sendkey</code> will have no effect. </p> <p>This command is only available on PC BIOS systems. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="set"> <div class="nav-panel"> <p> Next: <a href="#sha1sum" accesskey="n" rel="next">sha1sum</a>, Previous: <a href="#sendkey" accesskey="p" rel="prev">sendkey</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="set-1"><span>17.4.69 set<a class="copiable-link" href="#set-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-set"><span class="category-def">Command: </span><span><strong class="def-name">set</strong> <var class="def-var-arguments">[envvar=value]</var><a class="copiable-link" href="#index-set"> ¶</a></span></dt> <dd><p>Set the environment variable <var class="var">envvar</var> to <var class="var">value</var>. If invoked with no arguments, print all environment variables with their values. For the list of environment variables currently used by GRUB itself see the relevant section see <a class="pxref" href="#Environment">GRUB environment variables</a>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="sha1sum"> <div class="nav-panel"> <p> Next: <a href="#sha256sum" accesskey="n" rel="next">sha256sum</a>, Previous: <a href="#set" accesskey="p" rel="prev">set</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="sha1sum-1"><span>17.4.70 sha1sum<a class="copiable-link" href="#sha1sum-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-sha1sum"><span class="category-def">Command: </span><span><strong class="def-name">sha1sum</strong> <var class="def-var-arguments">arg …</var><a class="copiable-link" href="#index-sha1sum"> ¶</a></span></dt> <dd><p>Alias for <code class="code">hashsum --hash sha1 arg …</code>. See command <code class="command">hashsum</code> (see <a class="pxref" href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="sha256sum"> <div class="nav-panel"> <p> Next: <a href="#sha512sum" accesskey="n" rel="next">sha512sum</a>, Previous: <a href="#sha1sum" accesskey="p" rel="prev">sha1sum</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="sha256sum-1"><span>17.4.71 sha256sum<a class="copiable-link" href="#sha256sum-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-sha256sum"><span class="category-def">Command: </span><span><strong class="def-name">sha256sum</strong> <var class="def-var-arguments">arg …</var><a class="copiable-link" href="#index-sha256sum"> ¶</a></span></dt> <dd><p>Alias for <code class="code">hashsum --hash sha256 arg …</code>. See command <code class="command">hashsum</code> (see <a class="pxref" href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="sha512sum"> <div class="nav-panel"> <p> Next: <a href="#sleep" accesskey="n" rel="next">sleep</a>, Previous: <a href="#sha256sum" accesskey="p" rel="prev">sha256sum</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="sha512sum-1"><span>17.4.72 sha512sum<a class="copiable-link" href="#sha512sum-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-sha512sum"><span class="category-def">Command: </span><span><strong class="def-name">sha512sum</strong> <var class="def-var-arguments">arg …</var><a class="copiable-link" href="#index-sha512sum"> ¶</a></span></dt> <dd><p>Alias for <code class="code">hashsum --hash sha512 arg …</code>. See command <code class="command">hashsum</code> (see <a class="pxref" href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="sleep"> <div class="nav-panel"> <p> Next: <a href="#smbios" accesskey="n" rel="next">smbios</a>, Previous: <a href="#sha512sum" accesskey="p" rel="prev">sha512sum</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="sleep-1"><span>17.4.73 sleep<a class="copiable-link" href="#sleep-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-sleep"><span class="category-def">Command: </span><span><strong class="def-name">sleep</strong> <var class="def-var-arguments">[<samp class="option">--verbose</samp>] [<samp class="option">--interruptible</samp>] count</var><a class="copiable-link" href="#index-sleep"> ¶</a></span></dt> <dd><p>Sleep for <var class="var">count</var> seconds. If option <samp class="option">--interruptible</samp> is given, allow pressing <kbd class="key">ESC</kbd>, <kbd class="key">F4</kbd> or holding down <kbd class="key">SHIFT</kbd> to interrupt sleep. With <samp class="option">--verbose</samp> show countdown of remaining seconds. Exit code is set to 0 if timeout expired and to 1 if timeout was interrupted using any of the mentioned keys. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="smbios"> <div class="nav-panel"> <p> Next: <a href="#source" accesskey="n" rel="next">source</a>, Previous: <a href="#sleep" accesskey="p" rel="prev">sleep</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="smbios-1"><span>17.4.74 smbios<a class="copiable-link" href="#smbios-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-smbios"><span class="category-def">Command: </span><span><strong class="def-name">smbios</strong> <var class="def-var-arguments">[<samp class="option">--type</samp> <var class="var">type</var>] [<samp class="option">--handle</samp> <var class="var">handle</var>] [<samp class="option">--match</samp> <var class="var">match</var>] (<samp class="option">--get-byte</samp> | <samp class="option">--get-word</samp> | <samp class="option">--get-dword</samp> | <samp class="option">--get-qword</samp> | <samp class="option">--get-string</samp> | <samp class="option">--get-uuid</samp>) <var class="var">offset</var> [<samp class="option">--set</samp> <var class="var">variable</var>]</var><a class="copiable-link" href="#index-smbios"> ¶</a></span></dt> <dd><p>Retrieve SMBIOS information. </p> <p>The <code class="command">smbios</code> command returns the value of a field in an SMBIOS structure. The following options determine which structure to select. </p> <ul class="itemize mark-bullet"> <li>Specifying <samp class="option">--type</samp> will select structures with a matching <var class="var">type</var>. The type can be any integer from 0 to 255. </li><li>Specifying <samp class="option">--handle</samp> will select structures with a matching <var class="var">handle</var>. The handle can be any integer from 0 to 65535. </li><li>Specifying <samp class="option">--match</samp> will select structure number <var class="var">match</var> in the filtered list of structures; e.g. <code class="code">smbios --type 4 --match 2</code> will select the second Process Information (Type 4) structure. The list is always ordered the same as the hardware’s SMBIOS table. The match number must be a positive integer. If unspecified, the first matching structure will be selected. </li></ul> <p>The remaining options determine which field in the selected SMBIOS structure to return. Only one of these options may be specified at a time. </p> <ul class="itemize mark-bullet"> <li>When given <samp class="option">--get-byte</samp>, return the value of the byte at <var class="var">offset</var> bytes into the selected SMBIOS structure. It will be formatted as an unsigned decimal integer. </li><li>When given <samp class="option">--get-word</samp>, return the value of the word (two bytes) at <var class="var">offset</var> bytes into the selected SMBIOS structure. It will be formatted as an unsigned decimal integer. </li><li>When given <samp class="option">--get-dword</samp>, return the value of the dword (four bytes) at <var class="var">offset</var> bytes into the selected SMBIOS structure. It will be formatted as an unsigned decimal integer. </li><li>When given <samp class="option">--get-qword</samp>, return the value of the qword (eight bytes) at <var class="var">offset</var> bytes into the selected SMBIOS structure. It will be formatted as an unsigned decimal integer. </li><li>When given <samp class="option">--get-string</samp>, return the string with its index found at <var class="var">offset</var> bytes into the selected SMBIOS structure. </li><li>When given <samp class="option">--get-uuid</samp>, return the value of the UUID (sixteen bytes) at <var class="var">offset</var> bytes into the selected SMBIOS structure. It will be formatted as lower-case hyphenated hexadecimal digits, with the first three fields as little-endian, and the rest printed byte-by-byte. </li></ul> <p>The default action is to print the value of the requested field to the console, but a variable name can be specified with <samp class="option">--set</samp> to store the value instead of printing it. </p> <p>For example, this will store and then display the system manufacturer’s name. </p> <div class="example"> <pre class="example-preformatted">smbios --type 1 --get-string 4 --set system_manufacturer echo $system_manufacturer </pre></div> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="source"> <div class="nav-panel"> <p> Next: <a href="#test" accesskey="n" rel="next">test</a>, Previous: <a href="#smbios" accesskey="p" rel="prev">smbios</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="source-1"><span>17.4.75 source<a class="copiable-link" href="#source-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-source"><span class="category-def">Command: </span><span><strong class="def-name">source</strong> <var class="def-var-arguments">file</var><a class="copiable-link" href="#index-source"> ¶</a></span></dt> <dd><p>Read <var class="var">file</var> as a configuration file, as if its contents had been incorporated directly into the sourcing file. Unlike <code class="command">configfile</code> (see <a class="pxref" href="#configfile">configfile</a>), this executes the contents of <var class="var">file</var> without changing context: any environment variable changes made by the commands in <var class="var">file</var> will be preserved after <code class="command">source</code> returns, and the menu will not be shown immediately. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="test"> <div class="nav-panel"> <p> Next: <a href="#true" accesskey="n" rel="next">true</a>, Previous: <a href="#source" accesskey="p" rel="prev">source</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="test-1"><span>17.4.76 test<a class="copiable-link" href="#test-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-test"><span class="category-def">Command: </span><span><strong class="def-name">test</strong> <var class="def-var-arguments">expression</var><a class="copiable-link" href="#index-test"> ¶</a></span></dt> <dd><p>Evaluate <var class="var">expression</var> and return zero exit status if result is true, non zero status otherwise. </p> <p><var class="var">expression</var> is one of: </p> <dl class="table"> <dt><var class="var">string1</var> <code class="code">==</code> <var class="var">string2</var></dt> <dd><p>the strings are equal </p></dd> <dt><var class="var">string1</var> <code class="code">!=</code> <var class="var">string2</var></dt> <dd><p>the strings are not equal </p></dd> <dt><var class="var">string1</var> <code class="code"><</code> <var class="var">string2</var></dt> <dd><p><var class="var">string1</var> is lexicographically less than <var class="var">string2</var> </p></dd> <dt><var class="var">string1</var> <code class="code"><=</code> <var class="var">string2</var></dt> <dd><p><var class="var">string1</var> is lexicographically less or equal than <var class="var">string2</var> </p></dd> <dt><var class="var">string1</var> <code class="code">></code> <var class="var">string2</var></dt> <dd><p><var class="var">string1</var> is lexicographically greater than <var class="var">string2</var> </p></dd> <dt><var class="var">string1</var> <code class="code">>=</code> <var class="var">string2</var></dt> <dd><p><var class="var">string1</var> is lexicographically greater or equal than <var class="var">string2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-eq</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is equal to <var class="var">integer2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-ge</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is greater than or equal to <var class="var">integer2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-gt</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is greater than <var class="var">integer2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-le</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is less than or equal to <var class="var">integer2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-lt</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is less than <var class="var">integer2</var> </p></dd> <dt><var class="var">integer1</var> <code class="code">-ne</code> <var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is not equal to <var class="var">integer2</var> </p></dd> <dt><var class="var">prefix</var><var class="var">integer1</var> <code class="code">-pgt</code> <var class="var">prefix</var><var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is greater than <var class="var">integer2</var> after stripping off common non-numeric <var class="var">prefix</var>. </p></dd> <dt><var class="var">prefix</var><var class="var">integer1</var> <code class="code">-plt</code> <var class="var">prefix</var><var class="var">integer2</var></dt> <dd><p><var class="var">integer1</var> is less than <var class="var">integer2</var> after stripping off common non-numeric <var class="var">prefix</var>. </p></dd> <dt><var class="var">file1</var> <code class="code">-nt</code> <var class="var">file2</var></dt> <dd><p><var class="var">file1</var> is newer than <var class="var">file2</var> (modification time). Optionally numeric <var class="var">bias</var> may be directly appended to <code class="code">-nt</code> in which case it is added to the first file modification time. </p></dd> <dt><var class="var">file1</var> <code class="code">-ot</code> <var class="var">file2</var></dt> <dd><p><var class="var">file1</var> is older than <var class="var">file2</var> (modification time). Optionally numeric <var class="var">bias</var> may be directly appended to <code class="code">-ot</code> in which case it is added to the first file modification time. </p></dd> <dt><code class="code">-d</code> <var class="var">file</var></dt> <dd><p><var class="var">file</var> exists and is a directory </p></dd> <dt><code class="code">-e</code> <var class="var">file</var></dt> <dd><p><var class="var">file</var> exists </p></dd> <dt><code class="code">-f</code> <var class="var">file</var></dt> <dd><p><var class="var">file</var> exists and is not a directory </p></dd> <dt><code class="code">-s</code> <var class="var">file</var></dt> <dd><p><var class="var">file</var> exists and has a size greater than zero </p></dd> <dt><code class="code">-n</code> <var class="var">string</var></dt> <dd><p>the length of <var class="var">string</var> is nonzero </p></dd> <dt><var class="var">string</var></dt> <dd><p><var class="var">string</var> is equivalent to <code class="code">-n <var class="var">string</var></code> </p></dd> <dt><code class="code">-z</code> <var class="var">string</var></dt> <dd><p>the length of <var class="var">string</var> is zero </p></dd> <dt><code class="code">(</code> <var class="var">expression</var> <code class="code">)</code></dt> <dd><p><var class="var">expression</var> is true </p></dd> <dt><code class="code">!</code> <var class="var">expression</var></dt> <dd><p><var class="var">expression</var> is false </p></dd> <dt><var class="var">expression1</var> <code class="code">-a</code> <var class="var">expression2</var></dt> <dd><p>both <var class="var">expression1</var> and <var class="var">expression2</var> are true </p></dd> <dt><var class="var">expression1</var> <var class="var">expression2</var></dt> <dd><p>both <var class="var">expression1</var> and <var class="var">expression2</var> are true. This syntax is not POSIX-compliant and is not recommended. </p></dd> <dt><var class="var">expression1</var> <code class="code">-o</code> <var class="var">expression2</var></dt> <dd><p>either <var class="var">expression1</var> or <var class="var">expression2</var> is true </p></dd> </dl> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="true"> <div class="nav-panel"> <p> Next: <a href="#trust" accesskey="n" rel="next">trust</a>, Previous: <a href="#test" accesskey="p" rel="prev">test</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="true-1"><span>17.4.77 true<a class="copiable-link" href="#true-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-true"><span class="category-def">Command: </span><span><strong class="def-name">true</strong><a class="copiable-link" href="#index-true"> ¶</a></span></dt> <dd><p>Do nothing, successfully. This is mainly useful in control constructs such as <code class="code">if</code> and <code class="code">while</code> (see <a class="pxref" href="#Shell_002dlike-scripting">Writing full configuration files directly</a>). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="trust"> <div class="nav-panel"> <p> Next: <a href="#trust_005fcertificate" accesskey="n" rel="next">trust_certificate</a>, Previous: <a href="#true" accesskey="p" rel="prev">true</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="trust-1"><span>17.4.78 trust<a class="copiable-link" href="#trust-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-trust"><span class="category-def">Command: </span><span><strong class="def-name">trust</strong> <var class="def-var-arguments">[<samp class="option">--skip-sig</samp>] pubkey_file</var><a class="copiable-link" href="#index-trust"> ¶</a></span></dt> <dd><p>Read public key from <var class="var">pubkey_file</var> and add it to GRUB’s internal list of trusted public keys. These keys are used to validate digital signatures when environment variable <code class="code">check_signatures</code> is set to <code class="code">enforce</code>. Note that if <code class="code">check_signatures</code> is set to <code class="code">enforce</code> when <code class="command">trust</code> executes, then <var class="var">pubkey_file</var> must itself be properly signed. The <samp class="option">--skip-sig</samp> option can be used to disable signature-checking when reading <var class="var">pubkey_file</var> itself. It is expected that <samp class="option">--skip-sig</samp> is useful for testing and manual booting. See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="trust_005fcertificate"> <div class="nav-panel"> <p> Next: <a href="#unset" accesskey="n" rel="next">unset</a>, Previous: <a href="#trust" accesskey="p" rel="prev">trust</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="trust_005fcertificate-1"><span>17.4.79 trust_certificate<a class="copiable-link" href="#trust_005fcertificate-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-trust_005fcertificate"><span class="category-def">Command: </span><span><strong class="def-name">trust_certificate</strong> <var class="def-var-arguments">x509_certificate</var><a class="copiable-link" href="#index-trust_005fcertificate"> ¶</a></span></dt> <dd><p>Read an DER-formatted x509 certificate from the file <var class="var">x509_certificate</var> and add it to GRUB’s internal list of trusted x509 certificates. These certificates are used to validate appended signatures when the environment variable <code class="code">check_appended_signatures</code> is set to <code class="code">enforce</code> or <code class="code">forced</code>. </p> <p>Note that if <code class="code">check_appended_signatures</code> is set to <code class="code">enforce</code> or <code class="code">forced</code> when <code class="command">trust_certificate</code> is executed, then <var class="var">x509_certificate</var> must itself bear an appended signature. (It is not sufficient that <var class="var">x509_certificate</var> be signed by a trusted certificate according to the x509 rules: grub does not include support for validating signatures within x509 certificates themselves.) </p> <p>See See <a class="xref" href="#Using-appended-signatures">Using appended signatures in GRUB</a> for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="unset"> <div class="nav-panel"> <p> Next: <a href="#verify_005fappended" accesskey="n" rel="next">verify_appended</a>, Previous: <a href="#trust_005fcertificate" accesskey="p" rel="prev">trust_certificate</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="unset-1"><span>17.4.80 unset<a class="copiable-link" href="#unset-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-unset"><span class="category-def">Command: </span><span><strong class="def-name">unset</strong> <var class="def-var-arguments">envvar</var><a class="copiable-link" href="#index-unset"> ¶</a></span></dt> <dd><p>Unset the environment variable <var class="var">envvar</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="verify_005fappended"> <div class="nav-panel"> <p> Next: <a href="#verify_005fdetached" accesskey="n" rel="next">verify_detached</a>, Previous: <a href="#unset" accesskey="p" rel="prev">unset</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="verify_005fappended-1"><span>17.4.81 verify_appended<a class="copiable-link" href="#verify_005fappended-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-verify_005fappended"><span class="category-def">Command: </span><span><strong class="def-name">verify_appended</strong> <var class="def-var-arguments">file</var><a class="copiable-link" href="#index-verify_005fappended"> ¶</a></span></dt> <dd><p>Verifies an appended signature on <var class="var">file</var> against the trusted certificates known to GRUB (See see <a class="pxref" href="#list_005fcertificates">list_certificates</a>, see <a class="pxref" href="#trust_005fcertificate">trust_certificate</a>, and see <a class="pxref" href="#distrust_005fcertificate">distrust_certificate</a>). </p> <p>Exit code <code class="code">$?</code> is set to 0 if the signature validates successfully. If validation fails, it is set to a non-zero value. See See <a class="xref" href="#Using-appended-signatures">Using appended signatures in GRUB</a>, for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="verify_005fdetached"> <div class="nav-panel"> <p> Next: <a href="#videoinfo" accesskey="n" rel="next">videoinfo</a>, Previous: <a href="#verify_005fappended" accesskey="p" rel="prev">verify_appended</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="verify_005fdetached-1"><span>17.4.82 verify_detached<a class="copiable-link" href="#verify_005fdetached-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-verify_005fdetached"><span class="category-def">Command: </span><span><strong class="def-name">verify_detached</strong> <var class="def-var-arguments">[<samp class="option">--skip-sig</samp>] file signature_file [pubkey_file]</var><a class="copiable-link" href="#index-verify_005fdetached"> ¶</a></span></dt> <dd><p>Verifies a GPG-style detached signature, where the signed file is <var class="var">file</var>, and the signature itself is in file <var class="var">signature_file</var>. Optionally, a specific public key to use can be specified using <var class="var">pubkey_file</var>. When environment variable <code class="code">check_signatures</code> is set to <code class="code">enforce</code>, then <var class="var">pubkey_file</var> must itself be properly signed by an already-trusted key. An unsigned <var class="var">pubkey_file</var> can be loaded by specifying <samp class="option">--skip-sig</samp>. If <var class="var">pubkey_file</var> is omitted, then public keys from GRUB’s trusted keys (see <a class="pxref" href="#list_005ftrusted">list_trusted</a>, see <a class="pxref" href="#trust">trust</a>, and see <a class="pxref" href="#distrust">distrust</a>) are tried. </p> <p>Exit code <code class="code">$?</code> is set to 0 if the signature validates successfully. If validation fails, it is set to a non-zero value. See <a class="xref" href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures in GRUB</a>, for more information. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="videoinfo"> <div class="nav-panel"> <p> Next: <a href="#wrmsr" accesskey="n" rel="next">wrmsr</a>, Previous: <a href="#verify_005fdetached" accesskey="p" rel="prev">verify_detached</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="videoinfo-1"><span>17.4.83 videoinfo<a class="copiable-link" href="#videoinfo-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-videoinfo"><span class="category-def">Command: </span><span><strong class="def-name">videoinfo</strong> <var class="def-var-arguments">[[WxH]xD]</var><a class="copiable-link" href="#index-videoinfo"> ¶</a></span></dt> <dd><p>List available video modes. If resolution is given, show only matching modes. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="wrmsr"> <div class="nav-panel"> <p> Previous: <a href="#videoinfo" accesskey="p" rel="prev">videoinfo</a>, Up: <a href="#Command_002dline-commands" accesskey="u" rel="up">Command-line commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="wrmsr-1"><span>17.4.84 wrmsr<a class="copiable-link" href="#wrmsr-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-wrmsr"><span class="category-def">Command:: </span><span><strong class="def-name">wrmsr</strong> <var class="def-var-arguments">0xADDR 0xVALUE</var><a class="copiable-link" href="#index-wrmsr"> ¶</a></span></dt> <dd><p>Write a 0xVALUE to a model-specific register at address 0xADDR. </p> <p>Please note that on SMP systems, writing to a MSR that has a scope per hardware thread, implies that the value that is written only applies to the particular cpu/core/thread that runs the command. </p> <p>Also, if you specify a reserved or unimplemented MSR address, it will cause a general protection exception (which is not currently being handled) and the system will reboot. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). This is done to prevent subverting various security mechanisms. </p></dd></dl> <hr> </div> </div> <div class="section-level-extent" id="Networking-commands"> <div class="nav-panel"> <p> Next: <a href="#Undocumented-commands" accesskey="n" rel="next">Commands currently undocumented</a>, Previous: <a href="#Command_002dline-commands" accesskey="p" rel="prev">Command-line commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Networking-commands-1"><span>17.5 Networking commands<a class="copiable-link" href="#Networking-commands-1"> ¶</a></span></h3> <ul class="mini-toc"> <li><a href="#net_005fadd_005faddr" accesskey="1">net_add_addr</a></li> <li><a href="#net_005fadd_005fdns" accesskey="2">net_add_dns</a></li> <li><a href="#net_005fadd_005froute" accesskey="3">net_add_route</a></li> <li><a href="#net_005fbootp" accesskey="4">net_bootp</a></li> <li><a href="#net_005fdel_005faddr" accesskey="5">net_del_addr</a></li> <li><a href="#net_005fdel_005fdns" accesskey="6">net_del_dns</a></li> <li><a href="#net_005fdel_005froute" accesskey="7">net_del_route</a></li> <li><a href="#net_005fdhcp" accesskey="8">net_dhcp</a></li> <li><a href="#net_005fbootp6" accesskey="9">net_bootp6</a></li> <li><a href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a></li> <li><a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a></li> <li><a href="#net_005fls_005faddr">net_ls_addr</a></li> <li><a href="#net_005fls_005fcards">net_ls_cards</a></li> <li><a href="#net_005fls_005fdns">net_ls_dns</a></li> <li><a href="#net_005fls_005froutes">net_ls_routes</a></li> <li><a href="#net_005fnslookup">net_nslookup</a></li> <li><a href="#net_005fset_005fvlan">net_set_vlan</a></li> </ul> <hr> <div class="subsection-level-extent" id="net_005fadd_005faddr"> <div class="nav-panel"> <p> Next: <a href="#net_005fadd_005fdns" accesskey="n" rel="next">net_add_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fadd_005faddr-1"><span>17.5.1 net_add_addr<a class="copiable-link" href="#net_005fadd_005faddr-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fadd_005faddr"><span class="category-def">Command: </span><span><strong class="def-name">net_add_addr</strong> <var class="def-var-arguments"><var class="var">interface</var> <var class="var">card</var> <var class="var">address</var></var><a class="copiable-link" href="#index-net_005fadd_005faddr"> ¶</a></span></dt> <dd><p>Configure additional network <var class="var">interface</var> with <var class="var">address</var> on a network <var class="var">card</var>. <var class="var">address</var> can be either IP in dotted decimal notation, or symbolic name which is resolved using DNS lookup. If successful, this command also adds local link routing entry to the default subnet of <var class="var">address</var> with name <var class="var">interface</var>‘<samp class="samp">:local</samp>’ via <var class="var">interface</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fadd_005fdns"> <div class="nav-panel"> <p> Next: <a href="#net_005fadd_005froute" accesskey="n" rel="next">net_add_route</a>, Previous: <a href="#net_005fadd_005faddr" accesskey="p" rel="prev">net_add_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fadd_005fdns-1"><span>17.5.2 net_add_dns<a class="copiable-link" href="#net_005fadd_005fdns-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fadd_005fdns"><span class="category-def">Command: </span><span><strong class="def-name">net_add_dns</strong> <var class="def-var-arguments"><var class="var">server</var></var><a class="copiable-link" href="#index-net_005fadd_005fdns"> ¶</a></span></dt> <dd><p>Resolve <var class="var">server</var> IP address and add to the list of DNS servers used during name lookup. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fadd_005froute"> <div class="nav-panel"> <p> Next: <a href="#net_005fbootp" accesskey="n" rel="next">net_bootp</a>, Previous: <a href="#net_005fadd_005fdns" accesskey="p" rel="prev">net_add_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fadd_005froute-1"><span>17.5.3 net_add_route<a class="copiable-link" href="#net_005fadd_005froute-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fadd_005froute"><span class="category-def">Command: </span><span><strong class="def-name">net_add_route</strong> <var class="def-var-arguments"><var class="var">shortname</var> <var class="var">ip</var>[/<var class="var">prefix</var>] [<var class="var">interface</var> | ‘<samp class="samp">gw</samp>’ <var class="var">gateway</var>]</var><a class="copiable-link" href="#index-net_005fadd_005froute"> ¶</a></span></dt> <dd><p>Add route to network with address <var class="var">ip</var> as modified by <var class="var">prefix</var> via either local <var class="var">interface</var> or <var class="var">gateway</var>. <var class="var">prefix</var> is optional and defaults to 32 for IPv4 address and 128 for IPv6 address. Route is identified by <var class="var">shortname</var> which can be used to remove it (see <a class="pxref" href="#net_005fdel_005froute">net_del_route</a>). </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fbootp"> <div class="nav-panel"> <p> Next: <a href="#net_005fdel_005faddr" accesskey="n" rel="next">net_del_addr</a>, Previous: <a href="#net_005fadd_005froute" accesskey="p" rel="prev">net_add_route</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fbootp-1"><span>17.5.4 net_bootp<a class="copiable-link" href="#net_005fbootp-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fbootp"><span class="category-def">Command: </span><span><strong class="def-name">net_bootp</strong> <var class="def-var-arguments">[<var class="var">card</var>]</var><a class="copiable-link" href="#index-net_005fbootp"> ¶</a></span></dt> <dd><p>Alias for net_dhcp, for compatibility with older Grub versions. Will perform the same DHCP handshake with potential fallback to BOOTP as the net_dhcp command (see <a class="pxref" href="#net_005fdhcp">net_dhcp</a>). </p> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fdel_005faddr"> <div class="nav-panel"> <p> Next: <a href="#net_005fdel_005fdns" accesskey="n" rel="next">net_del_dns</a>, Previous: <a href="#net_005fbootp" accesskey="p" rel="prev">net_bootp</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdel_005faddr-1"><span>17.5.5 net_del_addr<a class="copiable-link" href="#net_005fdel_005faddr-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fdel_005faddr"><span class="category-def">Command: </span><span><strong class="def-name">net_del_addr</strong> <var class="def-var-arguments"><var class="var">interface</var></var><a class="copiable-link" href="#index-net_005fdel_005faddr"> ¶</a></span></dt> <dd><p>Remove configured <var class="var">interface</var> with associated address. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fdel_005fdns"> <div class="nav-panel"> <p> Next: <a href="#net_005fdel_005froute" accesskey="n" rel="next">net_del_route</a>, Previous: <a href="#net_005fdel_005faddr" accesskey="p" rel="prev">net_del_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdel_005fdns-1"><span>17.5.6 net_del_dns<a class="copiable-link" href="#net_005fdel_005fdns-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fdel_005fdns"><span class="category-def">Command: </span><span><strong class="def-name">net_del_dns</strong> <var class="def-var-arguments"><var class="var">address</var></var><a class="copiable-link" href="#index-net_005fdel_005fdns"> ¶</a></span></dt> <dd><p>Remove <var class="var">address</var> from list of servers used during name lookup. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fdel_005froute"> <div class="nav-panel"> <p> Next: <a href="#net_005fdhcp" accesskey="n" rel="next">net_dhcp</a>, Previous: <a href="#net_005fdel_005fdns" accesskey="p" rel="prev">net_del_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdel_005froute-1"><span>17.5.7 net_del_route<a class="copiable-link" href="#net_005fdel_005froute-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fdel_005froute"><span class="category-def">Command: </span><span><strong class="def-name">net_del_route</strong> <var class="def-var-arguments"><var class="var">shortname</var></var><a class="copiable-link" href="#index-net_005fdel_005froute"> ¶</a></span></dt> <dd><p>Remove route entry identified by <var class="var">shortname</var>. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fdhcp"> <div class="nav-panel"> <p> Next: <a href="#net_005fbootp6" accesskey="n" rel="next">net_bootp6</a>, Previous: <a href="#net_005fdel_005froute" accesskey="p" rel="prev">net_del_route</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fdhcp-1"><span>17.5.8 net_dhcp<a class="copiable-link" href="#net_005fdhcp-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fdhcp"><span class="category-def">Command: </span><span><strong class="def-name">net_dhcp</strong> <var class="def-var-arguments">[<var class="var">card</var>]</var><a class="copiable-link" href="#index-net_005fdhcp"> ¶</a></span></dt> <dd><p>Perform configuration of <var class="var">card</var> using DHCP protocol. If no card name is specified, try to configure all existing cards. Falls back to the BOOTP protocol, if needed. If configuration was successful, interface with name <var class="var">card</var>‘<samp class="samp">:dhcp</samp>’ and configured address is added to <var class="var">card</var>. Additionally the following DHCP options are recognized and processed: </p> <dl class="table"> <dt>‘<samp class="samp">1 (Subnet Mask)</samp>’</dt> <dd><p>Used to calculate network local routing entry for interface <var class="var">card</var>‘<samp class="samp">:dhcp</samp>’. </p></dd> <dt>‘<samp class="samp">3 (Router)</samp>’</dt> <dd><p>Adds default route entry with the name <var class="var">card</var>‘<samp class="samp">:dhcp:default</samp>’ via gateway from DHCP option. Note that only option with single route is accepted. </p></dd> <dt>‘<samp class="samp">6 (Domain Name Server)</samp>’</dt> <dd><p>Adds all servers from option value to the list of servers used during name resolution. </p></dd> <dt>‘<samp class="samp">12 (Host Name)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_dhcp_hostname</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005fhostname">net_<var class="var"><interface></var>_hostname</a>) to the value of option. </p></dd> <dt>‘<samp class="samp">15 (Domain Name)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_dhcp_domain</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005fdomain">net_<var class="var"><interface></var>_domain</a>) to the value of option. </p></dd> <dt>‘<samp class="samp">17 (Root Path)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_dhcp_rootpath</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005frootpath">net_<var class="var"><interface></var>_rootpath</a>) to the value of option. </p></dd> <dt>‘<samp class="samp">18 (Extensions Path)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_dhcp_extensionspath</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005fextensionspath">net_<var class="var"><interface></var>_extensionspath</a>) to the value of option. </p></dd> <dt>‘<samp class="samp">66 (TFTP Server Name)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_dhcp_server_name</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname">net_<var class="var"><interface></var>_dhcp_server_name</a>) to the value of option. </p></dd> <dt>‘<samp class="samp">67 (Filename)</samp>’</dt> <dd><p>Sets environment variable ‘<samp class="samp">net_</samp>’<var class="var"><card></var>‘<samp class="samp">_boot_file</samp>’ (see <a class="pxref" href="#net_005f_003cinterface_003e_005fboot_005ffile">net_<var class="var"><interface></var>_boot_file</a>) to the value of option. </p></dd> </dl> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fbootp6"> <div class="nav-panel"> <p> Next: <a href="#net_005fget_005fdhcp_005foption" accesskey="n" rel="next">net_get_dhcp_option</a>, Previous: <a href="#net_005fdhcp" accesskey="p" rel="prev">net_dhcp</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fbootp6-1"><span>17.5.9 net_bootp6<a class="copiable-link" href="#net_005fbootp6-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fbootp6"><span class="category-def">Command: </span><span><strong class="def-name">net_bootp6</strong> <var class="def-var-arguments">[<var class="var">card</var>]</var><a class="copiable-link" href="#index-net_005fbootp6"> ¶</a></span></dt> <dd><p>Perform configuration of <var class="var">card</var> using DHCPv6 protocol. If no card name is specified, try to configure all existing cards. If configuration was successful, interface with name <var class="var">card</var>‘<samp class="samp">:dhcp6</samp>’ and configured address is added to <var class="var">card</var>. </p> <dl class="table"> <dt>‘<samp class="samp">1 (Domain Name Server)</samp>’</dt> <dd><p>Adds all servers from option value to the list of servers used during name resolution. </p></dd> </dl> </dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fget_005fdhcp_005foption"> <div class="nav-panel"> <p> Next: <a href="#net_005fipv6_005fautoconf" accesskey="n" rel="next">net_ipv6_autoconf</a>, Previous: <a href="#net_005fbootp6" accesskey="p" rel="prev">net_bootp6</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fget_005fdhcp_005foption-1"><span>17.5.10 net_get_dhcp_option<a class="copiable-link" href="#net_005fget_005fdhcp_005foption-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fget_005fdhcp_005foption"><span class="category-def">Command: </span><span><strong class="def-name">net_get_dhcp_option</strong> <var class="def-var-arguments"><var class="var">var</var> <var class="var">interface</var> <var class="var">number</var> <var class="var">type</var></var><a class="copiable-link" href="#index-net_005fget_005fdhcp_005foption"> ¶</a></span></dt> <dd><p>Request DHCP option <var class="var">number</var> of <var class="var">type</var> via <var class="var">interface</var>. <var class="var">type</var> can be one of ‘<samp class="samp">string</samp>’, ‘<samp class="samp">number</samp>’ or ‘<samp class="samp">hex</samp>’. If option is found, assign its value to variable <var class="var">var</var>. Values of types ‘<samp class="samp">number</samp>’ and ‘<samp class="samp">hex</samp>’ are converted to string representation. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fipv6_005fautoconf"> <div class="nav-panel"> <p> Next: <a href="#net_005fls_005faddr" accesskey="n" rel="next">net_ls_addr</a>, Previous: <a href="#net_005fget_005fdhcp_005foption" accesskey="p" rel="prev">net_get_dhcp_option</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fipv6_005fautoconf-1"><span>17.5.11 net_ipv6_autoconf<a class="copiable-link" href="#net_005fipv6_005fautoconf-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fipv6_005fautoconf"><span class="category-def">Command: </span><span><strong class="def-name">net_ipv6_autoconf</strong> <var class="def-var-arguments">[<var class="var">card</var>]</var><a class="copiable-link" href="#index-net_005fipv6_005fautoconf"> ¶</a></span></dt> <dd><p>Perform IPv6 autoconfiguration by adding to the <var class="var">card</var> interface with name <var class="var">card</var>‘<samp class="samp">:link</samp>’ and link local MAC-based address. If no card is specified, perform autoconfiguration for all existing cards. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fls_005faddr"> <div class="nav-panel"> <p> Next: <a href="#net_005fls_005fcards" accesskey="n" rel="next">net_ls_cards</a>, Previous: <a href="#net_005fipv6_005fautoconf" accesskey="p" rel="prev">net_ipv6_autoconf</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fls_005faddr-1"><span>17.5.12 net_ls_addr<a class="copiable-link" href="#net_005fls_005faddr-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fls_005faddr"><span class="category-def">Command: </span><span><strong class="def-name">net_ls_addr</strong><a class="copiable-link" href="#index-net_005fls_005faddr"> ¶</a></span></dt> <dd><p>List all configured interfaces with their MAC and IP addresses. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fls_005fcards"> <div class="nav-panel"> <p> Next: <a href="#net_005fls_005fdns" accesskey="n" rel="next">net_ls_dns</a>, Previous: <a href="#net_005fls_005faddr" accesskey="p" rel="prev">net_ls_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fls_005fcards-1"><span>17.5.13 net_ls_cards<a class="copiable-link" href="#net_005fls_005fcards-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fls_005fcards"><span class="category-def">Command: </span><span><strong class="def-name">net_ls_cards</strong><a class="copiable-link" href="#index-net_005fls_005fcards"> ¶</a></span></dt> <dd><p>List all detected network cards with their MAC address. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fls_005fdns"> <div class="nav-panel"> <p> Next: <a href="#net_005fls_005froutes" accesskey="n" rel="next">net_ls_routes</a>, Previous: <a href="#net_005fls_005fcards" accesskey="p" rel="prev">net_ls_cards</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fls_005fdns-1"><span>17.5.14 net_ls_dns<a class="copiable-link" href="#net_005fls_005fdns-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fls_005fdns"><span class="category-def">Command: </span><span><strong class="def-name">net_ls_dns</strong><a class="copiable-link" href="#index-net_005fls_005fdns"> ¶</a></span></dt> <dd><p>List addresses of DNS servers used during name lookup. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fls_005froutes"> <div class="nav-panel"> <p> Next: <a href="#net_005fnslookup" accesskey="n" rel="next">net_nslookup</a>, Previous: <a href="#net_005fls_005fdns" accesskey="p" rel="prev">net_ls_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fls_005froutes-1"><span>17.5.15 net_ls_routes<a class="copiable-link" href="#net_005fls_005froutes-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fls_005froutes"><span class="category-def">Command: </span><span><strong class="def-name">net_ls_routes</strong><a class="copiable-link" href="#index-net_005fls_005froutes"> ¶</a></span></dt> <dd><p>List routing entries. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fnslookup"> <div class="nav-panel"> <p> Next: <a href="#net_005fset_005fvlan" accesskey="n" rel="next">net_set_vlan</a>, Previous: <a href="#net_005fls_005froutes" accesskey="p" rel="prev">net_ls_routes</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fnslookup-1"><span>17.5.16 net_nslookup<a class="copiable-link" href="#net_005fnslookup-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fnslookup"><span class="category-def">Command: </span><span><strong class="def-name">net_nslookup</strong> <var class="def-var-arguments"><var class="var">name</var> [<var class="var">server</var>]</var><a class="copiable-link" href="#index-net_005fnslookup"> ¶</a></span></dt> <dd><p>Resolve address of <var class="var">name</var> using DNS server <var class="var">server</var>. If no server is given, use default list of servers. </p></dd></dl> <hr> </div> <div class="subsection-level-extent" id="net_005fset_005fvlan"> <div class="nav-panel"> <p> Previous: <a href="#net_005fnslookup" accesskey="p" rel="prev">net_nslookup</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="subsection" id="net_005fset_005fvlan-1"><span>17.5.17 net_set_vlan<a class="copiable-link" href="#net_005fset_005fvlan-1"> ¶</a></span></h4> <dl class="first-deffn"> <dt class="deffn" id="index-net_005fset_005fvlan"><span class="category-def">Command: </span><span><strong class="def-name">net_set_vlan</strong> <var class="def-var-arguments"><var class="var">interface</var> <var class="var">vlanid</var></var><a class="copiable-link" href="#index-net_005fset_005fvlan"> ¶</a></span></dt> <dd><p>Set the 802.1Q VLAN identifier on <var class="var">interface</var> to <var class="var">vlanid</var>. For example, to set the VLAN identifier on interface ‘<samp class="samp">efinet1</samp>’ to ‘<samp class="samp">100</samp>’: </p> <div class="example"> <pre class="example-preformatted">net_set_vlan efinet1 100 </pre></div> <p>The VLAN identifier can be removed by setting it to ‘<samp class="samp">0</samp>’: </p> <div class="example"> <pre class="example-preformatted">net_set_vlan efinet1 0 </pre></div> </dd></dl> <hr> </div> </div> <div class="section-level-extent" id="Undocumented-commands"> <div class="nav-panel"> <p> Previous: <a href="#Networking-commands" accesskey="p" rel="prev">Networking commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Available commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Commands-currently-undocumented"><span>17.6 Commands currently undocumented<a class="copiable-link" href="#Commands-currently-undocumented"> ¶</a></span></h3> <p>Unfortunately, not all GRUB commands are documented at this time due to developer resource constraints. One way to contribute back to the GRUB project would be to help document these commands, and submit patches or ideas to the mailing list. The following is a (most likely incomplete) list of undocumented or poorly documented commands and not all of them are allowed for all platforms. Running the command help from within the GRUB shell may provide more information on parameters and usage. </p> <ul class="itemize mark-bullet"> <li><code class="command">all_functional_test</code> - Run all functional tests. </li><li><code class="command">backtrace</code> - Print backtrace. </li><li><code class="command">boottime</code> - Show boot time statistics. </li><li><code class="command">cacheinfo</code> - Get disk cache info. </li><li><code class="command">cbmemc</code> - Show CBMEM console content. </li><li><code class="command">cmosset</code> - Set bit at BYTE:BIT in CMOS. </li><li><code class="command">coreboot_boottime</code> - Show coreboot boot time statistics. </li><li><code class="command">dump</code> - Show memory contents. </li><li><code class="command">efiemu_loadcore</code> - Load and initialize EFI emulator. </li><li><code class="command">efiemu_prepare</code> - Finalize loading of EFI emulator. </li><li><code class="command">efiemu_unload</code> - Unload EFI emulator. </li><li><code class="command">exit</code> - Exit from GRUB. </li><li><code class="command">extract_entries_configfile</code> - Load another config file but take only menu entries. </li><li><code class="command">extract_entries_source</code> - Load another config file without changing context but take only menu entries. </li><li><code class="command">extract_legacy_entries_configfile</code> - Parse legacy config in new context taking only menu entries </li><li><code class="command">extract_legacy_entries_source</code> - Parse legacy config in same context taking only menu entries </li><li><code class="command">extract_syslinux_entries_configfile</code> - Execute syslinux config in new context taking only menu entries </li><li><code class="command">extract_syslinux_entries_source</code> - Execute syslinux config in same context taking only menu entries </li><li><code class="command">fakebios</code> - Create BIOS-like structures for backward compatibility with existing OS. </li><li><code class="command">file</code> - Check if FILE is of specified type. </li><li><code class="command">fix_video</code> - Fix video problem. </li><li><code class="command">fpswa</code> - Display FPSWA version. </li><li><code class="command">functional_test</code> - Run all loaded functional tests. </li><li><code class="command">gdbstub_break</code> - Break into GDB </li><li><code class="command">gdbstub</code> - Start GDB stub on given port </li><li><code class="command">gdbstub_stop</code> - Stop GDB stub </li><li><code class="command">hdparm</code> - Get/set ATA disk parameters. </li><li><code class="command">hexdump_random</code> - Hexdump random data. </li><li><code class="command">inb</code> - Read 8-bit value from PORT. </li><li><code class="command">inl</code> - Read 32-bit value from PORT. </li><li><code class="command">inw</code> - Read 16-bit value from PORT. </li><li><code class="command">jpegtest</code> - Tests loading of JPEG bitmap. </li><li><code class="command">keymap</code> - Load a keyboard layout. </li><li><code class="command">legacy_check_password</code> - Simulate grub-legacy ‘password’ command in menu entry mode </li><li><code class="command">legacy_configfile</code> - Parse legacy config in new context </li><li><code class="command">legacy_password</code> - Simulate grub-legacy ‘password’ command </li><li><code class="command">legacy_source</code> - Parse legacy config in same context </li><li><code class="command">loadbios</code> - Load BIOS dump. </li><li><code class="command">lsacpi</code> - Show ACPI information. </li><li><code class="command">lsapm</code> - Show APM information. </li><li><code class="command">lscoreboot</code> - List coreboot tables. </li><li><code class="command">lsdev</code> - List devices. </li><li><code class="command">lsefi</code> - Display EFI handles. </li><li><code class="command">lsefimmap</code> - Display EFI memory map. </li><li><code class="command">lsefisystab</code> - Display EFI system tables. </li><li><code class="command">lsmmap</code> - List memory map provided by firmware. </li><li><code class="command">lspci</code> - List PCI devices. </li><li><code class="command">lssal</code> - Display SAL system table. </li><li><code class="command">lsspd</code> - Print Memory information. </li><li><code class="command">macppcbless</code> - Bless DIR of HFS or HFS+ partition for PPC macs. </li><li><code class="command">mactelbless</code> - Bless FILE of HFS or HFS+ partition for intel macs. </li><li><code class="command">net_set_vlan</code> - Set an interface’s vlan id. </li><li><code class="command">outb</code> - Write 8-bit VALUE to PORT. </li><li><code class="command">outl</code> - Write 32-bit VALUE to PORT. </li><li><code class="command">outw</code> - Write 16-bit VALUE to PORT. </li><li><code class="command">pcidump</code> - Show raw dump of the PCI configuration space. </li><li><code class="command">pngtest</code> - Tests loading of PNG bitmap. </li><li><code class="command">read_byte</code> - Read 8-bit value from ADDR. </li><li><code class="command">read_dword</code> - Read 32-bit value from ADDR. </li><li><code class="command">read_word</code> - Read 16-bit value from ADDR. </li><li><code class="command">setpci</code> - Manipulate PCI devices. </li><li><code class="command">suspend</code> - Return to IEEE1275 prompt. </li><li><code class="command">syslinux_configfile</code> - Execute syslinux config in new context </li><li><code class="command">syslinux_source</code> - Execute syslinux config in same context </li><li><code class="command">test_blockarg</code> - Print and execute block argument., 0 </li><li><code class="command">testload</code> - Load the same file in multiple ways. </li><li><code class="command">testspeed</code> - Test file read speed. </li><li><code class="command">tgatest</code> - Tests loading of TGA bitmap. </li><li><code class="command">time</code> - Measure time used by COMMAND </li><li><code class="command">tr</code> - Translate SET1 characters to SET2 in STRING. </li><li><code class="command">usb</code> - Test USB support. </li><li><code class="command">vbeinfo</code> - List available video modes. If resolution is given show only modes matching it. </li><li><code class="command">vbetest</code> - Test video subsystem. </li><li><code class="command">videotest</code> - Test video subsystem in mode WxH. </li><li><code class="command">write_byte</code> - Write 8-bit VALUE to ADDR. </li><li><code class="command">write_dword</code> - Write 32-bit VALUE to ADDR. </li><li><code class="command">write_word</code> - Write 16-bit VALUE to ADDR. </li><li><code class="command">xen_cat</code> - List Xen storage. </li><li><code class="command">xen_ls</code> - List Xen storage. </li><li><code class="command">xnu_devprop_load</code> - Load ‘device-properties’ dump. </li><li><code class="command">xnu_uuid</code> - Transform 64-bit UUID to format suitable for XNU. If -l is given keep it lowercase as done by blkid. </li><li><code class="command">zfs-bootfs</code> - Print ZFS-BOOTFSOBJ or store it into VARIABLE </li><li><code class="command">zfsinfo</code> - Print ZFS info about DEVICE. </li><li><code class="command">zfskey</code> - Import ZFS wrapping key stored in FILE. </li></ul> <hr> </div> </div> <div class="chapter-level-extent" id="Internationalisation"> <div class="nav-panel"> <p> Next: <a href="#Security" accesskey="n" rel="next">Security</a>, Previous: <a href="#Commands" accesskey="p" rel="prev">Available commands</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Internationalisation-1"><span>18 Internationalisation<a class="copiable-link" href="#Internationalisation-1"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#Charset" accesskey="1">Charset</a></li> <li><a href="#Filesystems" accesskey="2">Filesystems</a></li> <li><a href="#Output-terminal" accesskey="3">Output terminal</a></li> <li><a href="#Input-terminal" accesskey="4">Input terminal</a></li> <li><a href="#Gettext" accesskey="5">Gettext</a></li> <li><a href="#Regexp" accesskey="6">Regexp</a></li> <li><a href="#Other" accesskey="7">Other</a></li> </ul> <div class="section-level-extent" id="Charset"> <h3 class="section"><span>18.1 Charset<a class="copiable-link" href="#Charset"> ¶</a></span></h3> <p>GRUB uses UTF-8 internally other than in rendering where some GRUB-specific appropriate representation is used. All text files (including config) are assumed to be encoded in UTF-8. </p> </div> <div class="section-level-extent" id="Filesystems"> <h3 class="section"><span>18.2 Filesystems<a class="copiable-link" href="#Filesystems"> ¶</a></span></h3> <p>NTFS, JFS, UDF, HFS+, exFAT, long filenames in FAT, Joliet part of ISO9660 are treated as UTF-16 as per specification. AFS and BFS are read as UTF-8, again according to specification. BtrFS, cpio, tar, squash4, minix, minix2, minix3, ROMFS, ReiserFS, XFS, ext2, ext3, ext4, FAT (short names), F2FS, RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed to be UTF-8. This might be false on systems configured with legacy charset but as long as the charset used is superset of ASCII you should be able to access ASCII-named files. And it’s recommended to configure your system to use UTF-8 to access the filesystem, convmv may help with migration. ISO9660 (plain) filenames are specified as being ASCII or being described with unspecified escape sequences. GRUB assumes that the ISO9660 names are UTF-8 (since any ASCII is valid UTF-8). There are some old CD-ROMs which use CP437 in non-compliant way. You’re still able to access files with names containing only ASCII characters on such filesystems though. You’re also able to access any file if the filesystem contains valid Joliet (UTF-16) or RockRidge (UTF-8). AFFS, SFS and HFS never use unicode and GRUB assumes them to be in Latin1, Latin1 and MacRoman respectively. GRUB handles filesystem case-insensitivity however no attempt is performed at case conversion of international characters so e.g. a file named lowercase greek alpha is treated as different from the one named as uppercase alpha. The filesystems in questions are NTFS (except POSIX namespace), HFS+ (configurable at mkfs time, default insensitive), SFS (configurable at mkfs time, default insensitive), JFS (configurable at mkfs time, default sensitive), HFS, AFFS, FAT, exFAT and ZFS (configurable on per-subvolume basis by property “casesensitivity”, default sensitive). On ZFS subvolumes marked as case insensitive files containing lowercase international characters are inaccessible. Also like all supported filesystems except HFS+ and ZFS (configurable on per-subvolume basis by property “normalization”, default none) GRUB makes no attempt at check of canonical equivalence so a file name u-diaresis is treated as distinct from u+combining diaresis. This however means that in order to access file on HFS+ its name must be specified in normalisation form D. On normalized ZFS subvolumes filenames out of normalisation are inaccessible. </p> </div> <div class="section-level-extent" id="Output-terminal"> <h3 class="section"><span>18.3 Output terminal<a class="copiable-link" href="#Output-terminal"> ¶</a></span></h3> <p>Firmware output console “console” on ARC and IEEE1275 are limited to ASCII. </p> <p>BIOS firmware console and VGA text are limited to ASCII and some pseudographics. </p> <p>None of above mentioned is appropriate for displaying international and any unsupported character is replaced with question mark except pseudographics which we attempt to approximate with ASCII. </p> <p>EFI console on the other hand nominally supports UTF-16 but actual language coverage depends on firmware and may be very limited. </p> <p>The encoding used on serial can be chosen with <code class="command">terminfo</code> as either ASCII, UTF-8 or “visual UTF-8”. Last one is against the specification but results in correct rendering of right-to-left on some readers which don’t have own bidi implementation. </p> <p>On emu GRUB checks if charset is UTF-8 and uses it if so and uses ASCII otherwise. </p> <p>When using gfxterm or gfxmenu GRUB itself is responsible for rendering the text. In this case GRUB is limited by loaded fonts. If fonts contain all required characters then bidirectional text, cursive variants and combining marks other than enclosing, half (e.g. left half tilde or combining overline) and double ones. Ligatures aren’t supported though. This should cover European, Middle Eastern (if you don’t mind lack of lam-alif ligature in Arabic) and East Asian scripts. Notable unsupported scripts are Brahmic family and derived as well as Mongolian, Tifinagh, Korean Jamo (precomposed characters have no problem) and tonal writing (2e5-2e9). GRUB also ignores deprecated (as specified in Unicode) characters (e.g. tags). GRUB also doesn’t handle so called “annotation characters” If you can complete either of two lists or, better, propose a patch to improve rendering, please contact developer team. </p> </div> <div class="section-level-extent" id="Input-terminal"> <h3 class="section"><span>18.4 Input terminal<a class="copiable-link" href="#Input-terminal"> ¶</a></span></h3> <p>Firmware console on BIOS, IEEE1275 and ARC doesn’t allow you to enter non-ASCII characters. EFI specification allows for such but author is unaware of any actual implementations. Serial input is currently limited for latin1 (unlikely to change). Own keyboard implementations (at_keyboard and usb_keyboard) supports any key but work on one-char-per-keystroke. So no dead keys or advanced input method. Also there is no keymap change hotkey. In practice it makes difficult to enter any text using non-Latin alphabet. Moreover all current input consumers are limited to ASCII. </p> </div> <div class="section-level-extent" id="Gettext"> <h3 class="section"><span>18.5 Gettext<a class="copiable-link" href="#Gettext"> ¶</a></span></h3> <p>GRUB supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set “lang” variable. </p> </div> <div class="section-level-extent" id="Regexp"> <h3 class="section"><span>18.6 Regexp<a class="copiable-link" href="#Regexp"> ¶</a></span></h3> <p>Regexps work on unicode characters, however no attempt at checking cannonical equivalence has been made. Moreover the classes like [:alpha:] match only ASCII subset. </p> </div> <div class="section-level-extent" id="Other"> <h3 class="section"><span>18.7 Other<a class="copiable-link" href="#Other"> ¶</a></span></h3> <p>Currently GRUB always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour datetime format but weekdays are translated. GRUB always uses the decimal number format with [0-9] as digits and . as descimal separator and no group separator. IEEE1275 aliases are matched case-insensitively except non-ASCII which is matched as binary. Similar behaviour is for matching OSBundleRequired. Since IEEE1275 aliases and OSBundleRequired don’t contain any non-ASCII it should never be a problem in practice. Case-sensitive identifiers are matched as raw strings, no canonical equivalence check is performed. Case-insenstive identifiers are matched as RAW but additionally [a-z] is equivalent to [A-Z]. GRUB-defined identifiers use only ASCII and so should user-defined ones. Identifiers containing non-ASCII may work but aren’t supported. Only the ASCII space characters (space U+0020, tab U+000b, CR U+000d and LF U+000a) are recognised. Other unicode space characters aren’t a valid field separator. <code class="command">test</code> (see <a class="pxref" href="#test">test</a>) tests <, >, <=, >=, -pgt and -plt compare the strings in the lexicographical order of unicode codepoints, replicating the behaviour of test from coreutils. environment variables and commands are listed in the same order. </p> <hr> </div> </div> <div class="chapter-level-extent" id="Security"> <div class="nav-panel"> <p> Next: <a href="#Platform-limitations" accesskey="n" rel="next">Platform limitations</a>, Previous: <a href="#Internationalisation" accesskey="p" rel="prev">Internationalisation</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Security-1"><span>19 Security<a class="copiable-link" href="#Security-1"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#Authentication-and-authorisation" accesskey="1">Authentication and authorisation in GRUB</a></li> <li><a href="#Using-GPG_002dstyle-digital-signatures" accesskey="2">Using GPG-style digital signatures in GRUB</a></li> <li><a href="#Using-appended-signatures" accesskey="3">Using appended signatures in GRUB</a></li> <li><a href="#UEFI-secure-boot-and-shim" accesskey="4">UEFI secure boot and shim support</a></li> <li><a href="#Secure-Boot-Advanced-Targeting" accesskey="5">Embedded information for generation number based revocation</a></li> <li><a href="#Measured-Boot" accesskey="6">Measuring boot components</a></li> <li><a href="#Lockdown" accesskey="7">Lockdown when booting on a secure setup</a></li> <li><a href="#Signing-GRUB-itself" accesskey="8">Signing GRUB itself</a></li> <li><a href="#Signing-GRUB-for-UEFI-secure-boot" accesskey="9">Signing GRUB for UEFI secure boot</a></li> <li><a href="#Signing-GRUB-with-an-appended-signature">Signing GRUB with an appended signature</a></li> </ul> <hr> <div class="section-level-extent" id="Authentication-and-authorisation"> <div class="nav-panel"> <p> Next: <a href="#Using-GPG_002dstyle-digital-signatures" accesskey="n" rel="next">Using GPG-style digital signatures in GRUB</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Authentication-and-authorisation-in-GRUB"><span>19.1 Authentication and authorisation in GRUB<a class="copiable-link" href="#Authentication-and-authorisation-in-GRUB"> ¶</a></span></h3> <p>By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone can get direct access to a GRUB shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems. </p> <p>However, in some environments, such as kiosks, it may be appropriate to lock down the boot loader to require authentication before performing certain operations. </p> <p>The ‘<samp class="samp">password</samp>’ (see <a class="pxref" href="#password">password</a>) and ‘<samp class="samp">password_pbkdf2</samp>’ (see <a class="pxref" href="#password_005fpbkdf2">password_pbkdf2</a>) commands can be used to define users, each of which has an associated password. ‘<samp class="samp">password</samp>’ sets the password in plain text, requiring <samp class="file">grub.cfg</samp> to be secure; ‘<samp class="samp">password_pbkdf2</samp>’ sets the password hashed using the Password-Based Key Derivation Function (RFC 2898), requiring the use of <code class="command">grub2-mkpasswd-pbkdf2</code> (see <a class="pxref" href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>) to generate password hashes. </p> <p>In order to enable authentication support, the ‘<samp class="samp">superusers</samp>’ environment variable must be set to a list of usernames, separated by any of spaces, commas, semicolons, pipes, or ampersands. Superusers are permitted to use the GRUB command line, edit menu entries, and execute any menu entry. If ‘<samp class="samp">superusers</samp>’ is set, then use of the command line and editing of menu entries are automatically restricted to superusers. Setting ‘<samp class="samp">superusers</samp>’ to empty string effectively disables both access to CLI and editing of menu entries. Building a grub image with ‘<samp class="samp">--disable-cli</samp>’ option will also disable access to CLI and editing of menu entries, as well as disabling rescue mode. Note: The environment variable needs to be exported to also affect the section defined by the ‘<samp class="samp">submenu</samp>’ command (see <a class="pxref" href="#submenu">submenu</a>). </p> <p>Other users may be allowed to execute specific menu entries by giving a list of usernames (as above) using the <samp class="option">--users</samp> option to the ‘<samp class="samp">menuentry</samp>’ command (see <a class="pxref" href="#menuentry">menuentry</a>). If the <samp class="option">--unrestricted</samp> option is used for a menu entry, then that entry is unrestricted. If the <samp class="option">--users</samp> option is not used for a menu entry, then that only superusers are able to use it. </p> <p>Putting this together, a typical <samp class="file">grub.cfg</samp> fragment might look like this: </p> <div class="example"> <div class="group"><pre class="example-preformatted">set superusers="root" password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring password user1 insecure menuentry "May be run by any user" --unrestricted { set root=(hd0,1) linux /vmlinuz } menuentry "Superusers only" --users "" { set root=(hd0,1) linux /vmlinuz single } menuentry "May be run by user1 or a superuser" --users user1 { set root=(hd0,2) chainloader +1 } </pre></div></div> <p>The <code class="command">grub2-mkconfig</code> program does not yet have built-in support for generating configuration files with authentication. You can use <samp class="file">/etc/grub.d/40_custom</samp> to add simple superuser authentication, by adding <kbd class="kbd">set superusers=</kbd> and <kbd class="kbd">password</kbd> or <kbd class="kbd">password_pbkdf2</kbd> commands. </p> <hr> </div> <div class="section-level-extent" id="Using-GPG_002dstyle-digital-signatures"> <div class="nav-panel"> <p> Next: <a href="#Using-appended-signatures" accesskey="n" rel="next">Using appended signatures in GRUB</a>, Previous: <a href="#Authentication-and-authorisation" accesskey="p" rel="prev">Authentication and authorisation in GRUB</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Using-GPG_002dstyle-digital-signatures-in-GRUB"><span>19.2 Using GPG-style digital signatures in GRUB<a class="copiable-link" href="#Using-GPG_002dstyle-digital-signatures-in-GRUB"> ¶</a></span></h3> <p>GRUB’s <samp class="file">core.img</samp> can optionally provide enforcement that all files subsequently read from disk are covered by a valid digital signature. This section does <strong class="strong">not</strong> cover how to ensure that your platform’s firmware (e.g., Coreboot) validates <samp class="file">core.img</samp>. </p> <p>If environment variable <code class="code">check_signatures</code> (see <a class="pxref" href="#check_005fsignatures">check_signatures</a>) is set to <code class="code">enforce</code>, then every attempt by the GRUB <samp class="file">core.img</samp> to load another file <samp class="file">foo</samp> implicitly invokes <code class="code">verify_detached foo foo.sig</code> (see <a class="pxref" href="#verify_005fdetached">verify_detached</a>). <code class="code">foo.sig</code> must contain a valid digital signature over the contents of <code class="code">foo</code>, which can be verified with a public key currently trusted by GRUB (see <a class="pxref" href="#list_005ftrusted">list_trusted</a>, see <a class="pxref" href="#trust">trust</a>, and see <a class="pxref" href="#distrust">distrust</a>). If validation fails, then file <samp class="file">foo</samp> cannot be opened. This failure may halt or otherwise impact the boot process. </p> <p>An initial trusted public key can be embedded within the GRUB <samp class="file">core.img</samp> using the <code class="code">--pubkey</code> option to <code class="command">grub2-install</code> (see <a class="pxref" href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>). </p> <p>GRUB uses GPG-style detached signatures (meaning that a file <samp class="file">foo.sig</samp> will be produced when file <samp class="file">foo</samp> is signed), and currently supports the DSA and RSA signing algorithms. A signing key can be generated as follows: </p> <div class="example"> <pre class="example-preformatted">gpg --gen-key </pre></div> <p>An individual file can be signed as follows: </p> <div class="example"> <pre class="example-preformatted">gpg --detach-sign /path/to/file </pre></div> <p>For successful validation of all of GRUB’s subcomponents and the loaded OS kernel, they must all be signed. One way to accomplish this is the following (after having already produced the desired <samp class="file">grub.cfg</samp> file, e.g., by running <code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>): </p> <div class="example"> <div class="group"><pre class="example-preformatted"># Edit /dev/shm/passphrase.txt to contain your signing key's passphrase for i in `find /boot -name "*.cfg" -or -name "*.lst" -or \ -name "*.mod" -or -name "vmlinuz*" -or -name "initrd*" -or \ -name "grubenv"`; do gpg --batch --detach-sign --passphrase-fd 0 $i < \ /dev/shm/passphrase.txt done shred /dev/shm/passphrase.txt </pre></div></div> <p>See also: <a class="ref" href="#check_005fsignatures">check_signatures</a>, <a class="ref" href="#verify_005fdetached">verify_detached</a>, <a class="ref" href="#trust">trust</a>, <a class="ref" href="#list_005ftrusted">list_trusted</a>, <a class="ref" href="#distrust">distrust</a>, <a class="ref" href="#load_005fenv">load_env</a>, <a class="ref" href="#save_005fenv">save_env</a>. </p> <p>Note that internally signature enforcement is controlled by setting the environment variable <code class="code">check_signatures</code> equal to <code class="code">enforce</code>. Passing one or more <code class="code">--pubkey</code> options to <code class="command">grub2-mkimage</code> implicitly defines <code class="code">check_signatures</code> equal to <code class="code">enforce</code> in <samp class="file">core.img</samp> prior to processing any configuration files. </p> <p>Note that signature checking does <strong class="strong">not</strong> prevent an attacker with (serial, physical, ...) console access from dropping manually to the GRUB console and executing: </p> <div class="example"> <pre class="example-preformatted">set check_signatures=no </pre></div> <p>To prevent this, password-protection (see <a class="pxref" href="#Authentication-and-authorisation">Authentication and authorisation in GRUB</a>) is essential. Note that even with GRUB password protection, GRUB itself cannot prevent someone with physical access to the machine from altering that machine’s firmware (e.g., Coreboot or BIOS) configuration to cause the machine to boot from a different (attacker-controlled) device. GRUB is at best only one link in a secure boot chain. </p> <hr> </div> <div class="section-level-extent" id="Using-appended-signatures"> <div class="nav-panel"> <p> Next: <a href="#UEFI-secure-boot-and-shim" accesskey="n" rel="next">UEFI secure boot and shim support</a>, Previous: <a href="#Using-GPG_002dstyle-digital-signatures" accesskey="p" rel="prev">Using GPG-style digital signatures in GRUB</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Using-appended-signatures-in-GRUB"><span>19.3 Using appended signatures in GRUB<a class="copiable-link" href="#Using-appended-signatures-in-GRUB"> ¶</a></span></h3> <p>GRUB supports verifying Linux-style ’appended signatures’ for secure boot. Appended signatures are PKCS#7 messages containing a signature over the contents of a file, plus some metadata, appended to the end of a file. A file with an appended signature ends with the magic string: </p> <div class="example"> <pre class="example-preformatted">~Module signature appended~\n </pre></div> <p>where <code class="code">\n</code> represents the line-feed character, <code class="code">0x0a</code>. </p> <p>Certificates can be managed at boot time using the see <a class="pxref" href="#trust_005fcertificate">trust_certificate</a>, see <a class="pxref" href="#distrust_005fcertificate">distrust_certificate</a> and see <a class="pxref" href="#list_005fcertificates">list_certificates</a> commands. Certificates can also be built in to the core image using the <code class="code">--x509</code> parameter to <code class="command">grub-install</code> or <code class="command">grub-mkimage</code>. </p> <p>A file can be explictly verified using the see <a class="pxref" href="#verify_005fappended">verify_appended</a> command. </p> <p>Only signatures made with the SHA-256 or SHA-512 hash algorithm are supported, and only RSA signatures are supported. </p> <p>A file can be signed with the <code class="command">sign-file</code> utility supplied with the Linux kernel source. For example, if you have <code class="code">signing.key</code> as the private key and <code class="code">certificate.der</code> as the x509 certificate containing the public key: </p> <div class="example"> <pre class="example-preformatted">sign-file SHA256 signing.key certificate.der vmlinux vmlinux.signed </pre></div> <p>Enforcement of signature verification is controlled by the <code class="code">check_appended_signatures</code> variable. </p> <ul class="itemize mark-bullet"> <li>‘<samp class="samp">no</samp>’: no verification is performed. This is the default when GRUB is not in see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a> mode. </li><li>‘<samp class="samp">enforce</samp>’: verification is performed. Verification can be disabled by setting the variable back to ‘<samp class="samp">no</samp>’. </li><li>‘<samp class="samp">forced</samp>’: verification is performed and cannot be disabled. This is set when GRUB is in Lockdown when the appendedsig module is loaded. </li></ul> <p>Unlike GPG-style signatures, not all files loaded by GRUB are required to be signed. Once verification is turned on, the following file types will have appended signatures verified: </p> <ul class="itemize mark-bullet"> <li>Linux kernels </li><li>GRUB modules, except those built into the core image </li><li>Any new certificate files to be trusted </li></ul> <p>ACPI tables and Device Tree images will not be checked for appended signatures but must be verified by another mechanism such as GPG-style signatures before they will be loaded. </p> <p>Unless lockdown mode is enabled, signature checking does <strong class="strong">not</strong> stop an attacker with console access from dropping manually to the GRUB console and executing: </p> <div class="example"> <pre class="example-preformatted">set check_appended_signatures=no </pre></div> <p>Refer to the section on password-protecting GRUB (see <a class="pxref" href="#Authentication-and-authorisation">Authentication and authorisation in GRUB</a>) for more information on preventing this. </p> <p>Additionally, unless lockdown mode is enabled: </p> <ul class="itemize mark-bullet"> <li>Special care must be taken around the <code class="command">loadenv</code> command, which can be used to turn off <code class="code">check_appended_signature</code>. </li><li>If the grub configuration file is loaded from the disk, anyone who can modify the file on disk can turn off <code class="code">check_appended_signature</code>. Consider embedding the configuration into the core grub image. </li></ul> <hr> </div> <div class="section-level-extent" id="UEFI-secure-boot-and-shim"> <div class="nav-panel"> <p> Next: <a href="#Secure-Boot-Advanced-Targeting" accesskey="n" rel="next">Embedded information for generation number based revocation</a>, Previous: <a href="#Using-appended-signatures" accesskey="p" rel="prev">Using appended signatures in GRUB</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="UEFI-secure-boot-and-shim-support"><span>19.4 UEFI secure boot and shim support<a class="copiable-link" href="#UEFI-secure-boot-and-shim-support"> ¶</a></span></h3> <p>The GRUB, except the <code class="command">chainloader</code> command, works with the UEFI secure boot and the shim. This functionality is provided by the shim_lock verifier. It is built into the <samp class="file">core.img</samp> and is registered if the UEFI secure boot is enabled. The ‘<samp class="samp">shim_lock</samp>’ variable is set to ‘<samp class="samp">y</samp>’ when shim_lock verifier is registered. If it is desired to use UEFI secure boot without shim, one can disable shim_lock by disabling shim verification with MokSbState UEFI variable or by building grub image with ‘<samp class="samp">--disable-shim-lock</samp>’ option. </p> <p>All GRUB modules not stored in the <samp class="file">core.img</samp>, OS kernels, ACPI tables, Device Trees, etc. have to be signed, e.g, using PGP. Additionally, the commands that can be used to subvert the UEFI secure boot mechanism, such as <code class="command">iorw</code> and <code class="command">memrw</code> will not be available when the UEFI secure boot is enabled. This is done for security reasons and are enforced by the GRUB Lockdown mechanism (see <a class="pxref" href="#Lockdown">Lockdown when booting on a secure setup</a>). </p> <hr> </div> <div class="section-level-extent" id="Secure-Boot-Advanced-Targeting"> <div class="nav-panel"> <p> Next: <a href="#Measured-Boot" accesskey="n" rel="next">Measuring boot components</a>, Previous: <a href="#UEFI-secure-boot-and-shim" accesskey="p" rel="prev">UEFI secure boot and shim support</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Embedded-information-for-generation-number-based-revocation"><span>19.5 Embedded information for generation number based revocation<a class="copiable-link" href="#Embedded-information-for-generation-number-based-revocation"> ¶</a></span></h3> <p>The Secure Boot Advanced Targeting (SBAT) is a mechanism to allow the revocation of components in the boot path by using generation numbers embedded into the EFI binaries. The SBAT metadata is located in an .sbat data section that has set of UTF-8 strings as comma-separated values (CSV). See <a class="uref" href="https://github.com/rhboot/shim/blob/main/SBAT.md">https://github.com/rhboot/shim/blob/main/SBAT.md</a> for more details. </p> <p>To add a data section containing the SBAT information into the binary, the <samp class="option">--sbat</samp> option of <code class="command">grub2-mkimage</code> command should be used. The content of a CSV file, encoded with UTF-8, is copied as is to the .sbat data section into the generated EFI binary. The CSV file can be stored anywhere on the file system. </p> <div class="example"> <pre class="example-preformatted">grub-mkimage -O x86_64-efi -o grubx64.efi -p '(tftp)/grub' --sbat sbat.csv efinet tftp </pre></div> <hr> </div> <div class="section-level-extent" id="Measured-Boot"> <div class="nav-panel"> <p> Next: <a href="#Lockdown" accesskey="n" rel="next">Lockdown when booting on a secure setup</a>, Previous: <a href="#Secure-Boot-Advanced-Targeting" accesskey="p" rel="prev">Embedded information for generation number based revocation</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Measuring-boot-components"><span>19.6 Measuring boot components<a class="copiable-link" href="#Measuring-boot-components"> ¶</a></span></h3> <p>If the tpm module is loaded and the platform has a Trusted Platform Module installed, GRUB will log each command executed and each file loaded into the TPM event log and extend the PCR values in the TPM correspondingly. All events will be logged into the PCR described below with a type of EV_IPL and an event description as described below. </p> <table class="multitable"> <thead><tr><th width="30%">Event type</th><th width="10%">PCR</th><th width="60%">Description</th></tr></thead> <tbody><tr><td width="30%">Command</td><td width="10%">8</td><td width="60%">All executed commands (including those from configuration files) will be logged and measured as entered with a prefix of “grub_cmd: “</td></tr> <tr><td width="30%">Kernel command line</td><td width="10%">8</td><td width="60%">Any command line passed to a kernel will be logged and measured as entered with a prefix of “kernel_cmdline: ”</td></tr> <tr><td width="30%">Module command line</td><td width="10%">8</td><td width="60%">Any command line passed to a kernel module will be logged and measured as entered with a prefix of “module_cmdline: “</td></tr> <tr><td width="30%">Files</td><td width="10%">9</td><td width="60%">Any file read by GRUB will be logged and measured with a descriptive text corresponding to the filename.</td></tr> </tbody> </table> <p>GRUB will not measure its own <samp class="file">core.img</samp> - it is expected that firmware will carry this out. GRUB will also not perform any measurements until the tpm module is loaded. As such it is recommended that the tpm module be built into <samp class="file">core.img</samp> in order to avoid a potential gap in measurement between <samp class="file">core.img</samp> being loaded and the tpm module being loaded. </p> <p>Measured boot is currently only supported on EFI and IBM IEEE1275 PowerPC platforms. </p> <hr> </div> <div class="section-level-extent" id="Lockdown"> <div class="nav-panel"> <p> Next: <a href="#Signing-GRUB-itself" accesskey="n" rel="next">Signing GRUB itself</a>, Previous: <a href="#Measured-Boot" accesskey="p" rel="prev">Measuring boot components</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Lockdown-when-booting-on-a-secure-setup"><span>19.7 Lockdown when booting on a secure setup<a class="copiable-link" href="#Lockdown-when-booting-on-a-secure-setup"> ¶</a></span></h3> <p>The GRUB can be locked down when booted on a secure boot environment, for example if UEFI or Power secure boot is enabled. On a locked down configuration, the GRUB will be restricted and some operations/commands cannot be executed. </p> <p>The ‘<samp class="samp">lockdown</samp>’ variable is set to ‘<samp class="samp">y</samp>’ when the GRUB is locked down. Otherwise it does not exit. </p> <hr> </div> <div class="section-level-extent" id="Signing-GRUB-itself"> <div class="nav-panel"> <p> Previous: <a href="#Lockdown" accesskey="p" rel="prev">Lockdown when booting on a secure setup</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Signing-GRUB-itself-1"><span>19.8 Signing GRUB itself<a class="copiable-link" href="#Signing-GRUB-itself-1"> ¶</a></span></h3> <p>To ensure a complete secure-boot chain, there must be a way for the code that loads GRUB to verify the integrity of the core image. </p> <p>This is ultimately platform-specific and individual platforms can define their own mechanisms. However, there are general-purpose mechanisms that can be used with GRUB. </p> </div> <div class="section-level-extent" id="Signing-GRUB-for-UEFI-secure-boot"> <h3 class="section"><span>19.9 Signing GRUB for UEFI secure boot<a class="copiable-link" href="#Signing-GRUB-for-UEFI-secure-boot"> ¶</a></span></h3> <p>On UEFI platforms, <samp class="file">core.img</samp> is a PE binary. Therefore, it can be signed with a tool such as <code class="command">pesign</code> or <code class="command">sbsign</code>. Refer to the suggestions in see <a class="pxref" href="#UEFI-secure-boot-and-shim">UEFI secure boot and shim support</a> to ensure that the final image works under UEFI secure boot and can maintain the secure-boot chain. It will also be necessary to enrol the public key used into a relevant firmware key database. </p> </div> <div class="section-level-extent" id="Signing-GRUB-with-an-appended-signature"> <h3 class="section"><span>19.10 Signing GRUB with an appended signature<a class="copiable-link" href="#Signing-GRUB-with-an-appended-signature"> ¶</a></span></h3> <p>The <samp class="file">core.elf</samp> itself can be signed with a Linux kernel module-style appended signature. </p> <p>To support IEEE1275 platforms where the boot image is often loaded directly from a disk partition rather than from a file system, the <samp class="file">core.elf</samp> can specify the size and location of the appended signature with an ELF note added by <code class="command">grub-install</code>. </p> <p>An image can be signed this way using the <code class="command">sign-file</code> command from the Linux kernel: </p> <div class="example"> <div class="group"><pre class="example-preformatted"># grub.key is your private key and certificate.der is your public key # Determine the size of the appended signature. It depends on the signing # certificate and the hash algorithm touch empty sign-file SHA256 grub.key certificate.der empty empty.sig SIG_SIZE=`stat -c '%s' empty.sig` rm empty empty.sig # Build a grub image with $SIG_SIZE reserved for the signature grub-install --appended-signature-size $SIG_SIZE --modules="..." ... # Replace the reserved size with a signature: # cut off the last $SIG_SIZE bytes with truncate's minus modifier truncate -s -$SIG_SIZE /boot/grub/powerpc-ieee1275/core.elf core.elf.unsigned # sign the trimmed file with an appended signature, restoring the correct size sign-file SHA256 grub.key certificate.der core.elf.unsigned core.elf.signed # Don't forget to install the signed image as required # (e.g. on powerpc-ieee1275, to the PReP partition) </pre></div></div> <p>As with UEFI secure boot, it is necessary to build in the required modules, or sign them separately. </p> <ul class="mini-toc"> <li><a href="#Command-line-and-menuentry-editor-protection" accesskey="1">Command line and menuentry editor protection</a></li> </ul> <div class="subsection-level-extent" id="Command-line-and-menuentry-editor-protection"> <h4 class="subsection"><span>19.10.1 Command line and menuentry editor protection<a class="copiable-link" href="#Command-line-and-menuentry-editor-protection"> ¶</a></span></h4> <p>The TPM key protector provides full disk encryption support on servers or virtual machine images, meanwhile keeping the boot process unattended. This prevents service disruptions by eliminating the need for manual password input during startup, improving system uptime and continuity. It is achieved by TPM, which verifies the integrity of boot components by checking cryptographic hashes against securely stored values, to confirm the disks are unlocked in a trusted state. </p> <p>However, for users to access the system interactively, some form of authentication is still required, as the disks are not unlocked by an authorized user. This raised concerns about using an unprotected ‘<samp class="samp">command-line interface</samp>’ (see <a class="pxref" href="#Command_002dline-interface">The flexible command-line interface</a>), as anyone could execute commands to access decrypted data. To address this issue, the LUKS password is used to ensure that only authorized users are granted access to the interface. Additionally, the ‘<samp class="samp">menu entry editor</samp>’ (see <a class="pxref" href="#Menu-entry-editor">Editing a menu entry</a>) is also safeguarded by the LUKS password, as modifying a boot entry is effectively the same as altering the <samp class="file">grub.cfg</samp> file read from encrypted files. </p> <p>It is worth mentioning that the built-in password support, as described in ‘<samp class="samp">Authentication and Authorization in GRUB</samp>’ (see <a class="pxref" href="#Authentication-and-authorisation">Authentication and authorisation in GRUB</a>), can also be used to protect the command-line interface from unauthorized access. However, it is not recommended to rely on this approach as it is an optional step. Setting it up requires additional manual intervention, which increases the risk of password leakage during the process. Moreover, the superuser list must be well maintained, and the password used cannot be synchronized with LUKS key rotation. </p> <hr> </div> </div> </div> <div class="chapter-level-extent" id="Platform-limitations"> <div class="nav-panel"> <p> Next: <a href="#Platform_002dspecific-operations" accesskey="n" rel="next">Outline</a>, Previous: <a href="#Security" accesskey="p" rel="prev">Security</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Platform-limitations-1"><span>20 Platform limitations<a class="copiable-link" href="#Platform-limitations-1"> ¶</a></span></h2> <p>GRUB2 is designed to be portable and is actually ported across platforms. We try to keep all platforms at the level. Unfortunately some platforms are better supported than others. This is detailed in current and 2 following sections. </p> <p>All platforms have an artificially GRUB imposed disk size restriction of 1 EiB. In some cases, larger disk sizes can be used, but access will not be allowed beyond 1 EiB. </p> <p>LUKS2 devices with size larger than 16 EiB are currently not supported. They can not be created as crypto devices by cryptomount, so can not even be partially read from. LUKS have no limitations other than those imposed by the format. </p> <p>ARC platform is unable to change datetime (firmware doesn’t seem to provide a function for it). EMU has similar limitation. </p> <p>On EMU platform no serial port is available. </p> <p>Console charset refers only to firmware-assisted console. gfxterm is always Unicode (see Internationalisation section for its limitations). Serial is configurable to UTF-8 or ASCII (see Internationalisation). In case of qemu and coreboot ports the refered console is vga_text. Loongson always uses gfxterm. </p> <p>Most limited one is ASCII. CP437 provides additionally pseudographics. GRUB2 doesn’t use any language characters from CP437 as often CP437 is replaced by national encoding compatible only in pseudographics. Unicode is the most versatile charset which supports many languages. However the actual console may be much more limited depending on firmware </p> <p>On BIOS, network is supported only if the image is loaded through network. On sparc64, GRUB is unable to determine which server it was booted from. </p> <p>Direct ATA/AHCI support allows to circumvent various firmware limitations but isn’t needed for normal operation except on baremetal ports. </p> <p>AT keyboard support allows keyboard layout remapping and support for keys not available through firmware. It isn’t needed for normal operation except baremetal ports. </p> <p>Speaker allows morse and spkmodem communication. </p> <p>USB support provides benefits similar to ATA (for USB disks) or AT (for USB keyboards). In addition it allows USBserial. </p> <p>Chainloading refers to the ability to load another bootloader through the same protocol </p> <p>Hints allow faster disk discovery by already knowing in advance which is the disk in question. On some platforms hints are correct unless you move the disk between boots. On other platforms it’s just an educated guess. Note that hint failure results in just reduced performance, not a failure </p> <p>BadRAM is the ability to mark some of the RAM as “bad”. Note: due to protocol limitations mips-loongson (with Linux protocol) and mips-qemu_mips can use only memory up to first hole. </p> <p>Bootlocation is ability of GRUB to automatically detect where it boots from. “disk” means the detection is limited to detecting the disk with partition being discovered on install time. “partition” means that disk and partiton can be automatically discovered. “file” means that boot image file name as well as disk and partition can be discovered. For consistency, default install ignores partition and relies solely on disk detection. If no bootlocation discovery is available or boot and grub-root disks are different, UUID is used instead. On ARC if no device to install to is specified, UUID is used instead as well. </p> <table class="multitable"> <tbody><tr><td width="20%"></td><td width="20%">BIOS</td><td width="20%">Coreboot</td><td width="20%">Multiboot</td><td width="20%">Qemu</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">console charset</td><td width="20%">CP437</td><td width="20%">CP437</td><td width="20%">CP437</td><td width="20%">CP437</td></tr> <tr><td width="20%">network</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">Speaker</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">chainloader</td><td width="20%">local</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">cpuid</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td></tr> <tr><td width="20%">rdmsr</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td></tr> <tr><td width="20%">wrmsr</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">guess</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">badram</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">compression</td><td width="20%">always</td><td width="20%">pointless</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">disk</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="20%"></td><td width="20%">ia32 EFI</td><td width="20%">amd64 EFI</td><td width="20%">ia32 IEEE1275</td><td width="20%">Itanium</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">Unicode</td><td width="20%">Unicode</td><td width="20%">ASCII</td><td width="20%">Unicode</td></tr> <tr><td width="20%">network</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">local</td><td width="20%">local</td><td width="20%">no</td><td width="20%">local</td></tr> <tr><td width="20%">cpuid</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">no</td></tr> <tr><td width="20%">rdmsr</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">no</td></tr> <tr><td width="20%">wrmsr</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">no</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">good</td><td width="20%">guess</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">compression</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">file</td><td width="20%">file</td><td width="20%">file, ignored</td><td width="20%">file</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="20%"></td><td width="20%">Loongson</td><td width="20%">sparc64</td><td width="20%">Powerpc</td><td width="20%">ARC</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">N/A</td><td width="20%">ASCII</td><td width="20%">ASCII</td><td width="20%">ASCII</td></tr> <tr><td width="20%">network</td><td width="20%">no</td><td width="20%">yes (*)</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">cpuid</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">rdmsr</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">wrmsr</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">hints</td><td width="20%">good</td><td width="20%">good</td><td width="20%">good</td><td width="20%">no</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">compression</td><td width="20%">configurable</td><td width="20%">no</td><td width="20%">no</td><td width="20%">configurable</td></tr> <tr><td width="20%">exit</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">no</td><td width="20%">partition</td><td width="20%">file</td><td width="20%">file (*)</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="20%"></td><td width="20%">MIPS qemu</td><td width="20%">emu</td><td width="20%">xen</td></tr> <tr><td width="20%">video</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">CP437</td><td width="20%">Unicode (*)</td><td width="20%">ASCII</td></tr> <tr><td width="20%">network</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">N/A</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">cpuid</td><td width="20%">no</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">rdmsr</td><td width="20%">no</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">wrmsr</td><td width="20%">no</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">PCI</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">compression</td><td width="20%">configurable</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">no</td><td width="20%">file</td><td width="20%">no</td></tr> </tbody> </table> <hr> </div> <div class="chapter-level-extent" id="Platform_002dspecific-operations"> <div class="nav-panel"> <p> Next: <a href="#Supported-kernels" accesskey="n" rel="next">Supported boot targets</a>, Previous: <a href="#Platform-limitations" accesskey="p" rel="prev">Platform limitations</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Outline"><span>21 Outline<a class="copiable-link" href="#Outline"> ¶</a></span></h2> <p>Some platforms have features which allows to implement some commands useless or not implementable on others. </p> <p>Quick summary: </p> <p>Information retrieval: </p> <ul class="itemize mark-bullet"> <li>mipsel-loongson: lsspd </li><li>mips-arc: lsdev </li><li>efi: lsefisystab, lssal, lsefimmap, lsefi </li><li>i386-pc: lsapm </li><li>i386-coreboot: lscoreboot, coreboot_boottime, cbmemc </li><li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi </li></ul> <p>Workarounds for platform-specific issues: </p><ul class="itemize mark-bullet"> <li>i386-efi/x86_64-efi: loadbios, fakebios, fix_video </li><li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): acpi (override ACPI tables) </li><li>i386-pc: drivemap </li><li>i386-pc: sendkey </li></ul> <p>Advanced operations for power users: </p><ul class="itemize mark-bullet"> <li>x86: iorw (direct access to I/O ports) </li></ul> <p>Miscelaneous: </p><ul class="itemize mark-bullet"> <li>cmos (x86-*, ieee1275, mips-qemu_mips, mips-loongson): cmostest (used on some laptops to check for special power-on key), cmosclean </li><li>i386-pc: play </li></ul> <hr> </div> <div class="chapter-level-extent" id="Supported-kernels"> <div class="nav-panel"> <p> Next: <a href="#Troubleshooting" accesskey="n" rel="next">Error messages produced by GRUB</a>, Previous: <a href="#Platform_002dspecific-operations" accesskey="p" rel="prev">Outline</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Supported-boot-targets"><span>22 Supported boot targets<a class="copiable-link" href="#Supported-boot-targets"> ¶</a></span></h2> <p>X86 support is summarised in the following table. “Yes” means that the kernel works on the given platform, “crashes” means an early kernel crash which we hope will be fixed by concerned kernel developers. “no” means GRUB doesn’t load the given kernel on a given platform. “headless” means that the kernel works but lacks console drivers (you can still use serial or network console). In case of “no” and “crashes” the reason is given in footnote. </p><table class="multitable"> <tbody><tr><td width="50%"></td><td width="22%">BIOS</td><td width="22%">Coreboot</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Freedos</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">yes</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">yes</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">yes</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">yes</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">crashes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">yes</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">yes</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="50%"></td><td width="22%">Multiboot</td><td width="22%">Qemu</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">crashes (5)</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">crashes (5)</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">?</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">?</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="50%"></td><td width="22%">ia32 EFI</td><td width="22%">amd64 EFI</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">yes (4)</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">yes</td><td width="22%">no (3)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (3)</td><td width="22%">yes</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">yes</td><td width="22%">yes</td></tr> </tbody> </table> <table class="multitable"> <tbody><tr><td width="50%"></td><td width="22%">ia32 IEEE1275</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">?</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">?</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td></tr> </tbody> </table> <ol class="enumerate"> <li> Requires BIOS </li><li> EFI only </li><li> 32-bit and 64-bit EFI have different structures and work in different CPU modes so it’s not possible to chainload 32-bit bootloader on 64-bit platform and vice-versa </li><li> Some modules may need to be disabled </li><li> Requires ACPI </li></ol> <p>PowerPC, IA64 and Sparc64 ports support only Linux. MIPS port supports Linux and multiboot2. </p> <ul class="mini-toc"> <li><a href="#Boot-tests" accesskey="1">Boot tests</a></li> </ul> <div class="section-level-extent" id="Boot-tests"> <h3 class="section"><span>22.1 Boot tests<a class="copiable-link" href="#Boot-tests"> ¶</a></span></h3> <p>As you have seen in previous chapter the support matrix is pretty big and some of the configurations are only rarely used. To ensure the quality bootchecks are available for all x86 targets except EFI chainloader, Appleloader and XNU. All x86 platforms have bootcheck facility except ieee1275. Multiboot, multiboot2, BIOS chainloader, ntldr and freebsd-bootloader boot targets are tested only with a fake kernel images. Only Linux is tested among the payloads using Linux protocols. </p> <p>Following variables must be defined: </p> <table class="multitable"> <tbody><tr><td width="30%">GRUB_PAYLOADS_DIR</td><td width="65%">directory containing the required kernels</td></tr> <tr><td width="30%">GRUB_CBFSTOOL</td><td width="65%">cbfstool from Coreboot package (for coreboot platform only)</td></tr> <tr><td width="30%">GRUB_COREBOOT_ROM</td><td width="65%">empty Coreboot ROM</td></tr> <tr><td width="30%">GRUB_QEMU_OPTS</td><td width="65%">additional options to be supplied to QEMU</td></tr> </tbody> </table> <p>Required files are: </p> <table class="multitable"> <tbody><tr><td width="40%">kfreebsd_env.i386</td><td width="55%">32-bit kFreeBSD device hints</td></tr> <tr><td width="40%">kfreebsd.i386</td><td width="55%">32-bit FreeBSD kernel image</td></tr> <tr><td width="40%">kfreebsd.x86_64, kfreebsd_env.x86_64</td><td width="55%">same from 64-bit kFreeBSD</td></tr> <tr><td width="40%">knetbsd.i386</td><td width="55%">32-bit NetBSD kernel image</td></tr> <tr><td width="40%">knetbsd.miniroot.i386</td><td width="55%">32-bit kNetBSD miniroot.kmod.</td></tr> <tr><td width="40%">knetbsd.x86_64, knetbsd.miniroot.x86_64</td><td width="55%">same from 64-bit kNetBSD</td></tr> <tr><td width="40%">kopenbsd.i386</td><td width="55%">32-bit OpenBSD kernel bsd.rd image</td></tr> <tr><td width="40%">kopenbsd.x86_64</td><td width="55%">same from 64-bit kOpenBSD</td></tr> <tr><td width="40%">linux.i386</td><td width="55%">32-bit Linux</td></tr> <tr><td width="40%">linux.x86_64</td><td width="55%">64-bit Linux</td></tr> </tbody> </table> <hr> </div> </div> <div class="chapter-level-extent" id="Troubleshooting"> <div class="nav-panel"> <p> Next: <a href="#User_002dspace-utilities" accesskey="n" rel="next">User-space utilities</a>, Previous: <a href="#Supported-kernels" accesskey="p" rel="prev">Supported boot targets</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="Error-messages-produced-by-GRUB"><span>23 Error messages produced by GRUB<a class="copiable-link" href="#Error-messages-produced-by-GRUB"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#GRUB-only-offers-a-rescue-shell" accesskey="1">GRUB only offers a rescue shell</a></li> <li><a href="#Firmware-stalls-instead-of-booting-GRUB" accesskey="2">Firmware stalls instead of booting GRUB</a></li> </ul> <hr> <div class="section-level-extent" id="GRUB-only-offers-a-rescue-shell"> <div class="nav-panel"> <p> Next: <a href="#Firmware-stalls-instead-of-booting-GRUB" accesskey="n" rel="next">Firmware stalls instead of booting GRUB</a>, Up: <a href="#Troubleshooting" accesskey="u" rel="up">Error messages produced by GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="GRUB-only-offers-a-rescue-shell-1"><span>23.1 GRUB only offers a rescue shell<a class="copiable-link" href="#GRUB-only-offers-a-rescue-shell-1"> ¶</a></span></h3> <p>GRUB’s normal start-up procedure involves setting the ‘<samp class="samp">prefix</samp>’ environment variable to a value set in the core image by <code class="command">grub2-install</code>, setting the ‘<samp class="samp">root</samp>’ variable to match, loading the ‘<samp class="samp">normal</samp>’ module from the prefix, and running the ‘<samp class="samp">normal</samp>’ command (see <a class="pxref" href="#normal">normal</a>). This command is responsible for reading <samp class="file">/boot/grub2/grub.cfg</samp>, running the menu, and doing all the useful things GRUB is supposed to do. </p> <p>If, instead, you only get a rescue shell, this usually means that GRUB failed to load the ‘<samp class="samp">normal</samp>’ module for some reason. It may be possible to work around this temporarily: for instance, if the reason for the failure is that ‘<samp class="samp">prefix</samp>’ is wrong (perhaps it refers to the wrong device, or perhaps the path to <samp class="file">/boot/grub</samp> was not correctly made relative to the device), then you can correct this and enter normal mode manually: </p> <div class="example"> <div class="group"><pre class="example-preformatted"># Inspect the current prefix (and other preset variables): set # Find out which devices are available: ls # Set to the correct value, which might be something like this: set prefix=(hd0,1)/grub set root=(hd0,1) insmod normal normal </pre></div></div> <p>However, any problem that leaves you in the rescue shell probably means that GRUB was not correctly installed. It may be more useful to try to reinstall it properly using <kbd class="kbd">grub2-install <var class="var">device</var></kbd> (see <a class="pxref" href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>). When doing this, there are a few things to remember: </p> <ul class="itemize mark-bullet"> <li>Drive ordering in your operating system may not be the same as the boot drive ordering used by your firmware. Do not assume that your first hard drive (e.g. ‘<samp class="samp">/dev/sda</samp>’) is the one that your firmware will boot from. <samp class="file">device.map</samp> (see <a class="pxref" href="#Device-map">The map between BIOS drives and OS devices</a>) can be used to override this, but it is usually better to use UUIDs or file system labels and avoid depending on drive ordering entirely. </li><li>At least on BIOS systems, if you tell <code class="command">grub2-install</code> to install GRUB to a partition but GRUB has already been installed in the master boot record, then the GRUB installation in the partition will be ignored. </li><li>If possible, it is generally best to avoid installing GRUB to a partition (unless it is a special partition for the use of GRUB alone, such as the BIOS Boot Partition used on GPT). Doing this means that GRUB may stop being able to read its core image due to a file system moving blocks around, such as while defragmenting, running checks, or even during normal operation. Installing to the whole disk device is normally more robust. </li><li>Check that GRUB actually knows how to read from the device and file system containing <samp class="file">/boot/grub</samp>. It will not be able to read from encrypted devices with unsupported encryption scheme, nor from file systems for which support has not yet been added to GRUB. </li></ul> <hr> </div> <div class="section-level-extent" id="Firmware-stalls-instead-of-booting-GRUB"> <div class="nav-panel"> <p> Previous: <a href="#GRUB-only-offers-a-rescue-shell" accesskey="p" rel="prev">GRUB only offers a rescue shell</a>, Up: <a href="#Troubleshooting" accesskey="u" rel="up">Error messages produced by GRUB</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Firmware-stalls-instead-of-booting-GRUB-1"><span>23.2 Firmware stalls instead of booting GRUB<a class="copiable-link" href="#Firmware-stalls-instead-of-booting-GRUB-1"> ¶</a></span></h3> <p>The EFI implementation of some older MacBook laptops stalls when it gets presented a grub-mkrescue ISO image for x86_64-efi target on an USB stick. Affected are models of year 2010 or earlier. Workaround is to zeroize the bytes 446 to 461 of the EFI partition, where mformat has put a partition table entry which claims partition start at block 0. This change will not hamper bootability on other machines. </p> <hr> </div> </div> <div class="chapter-level-extent" id="User_002dspace-utilities"> <div class="nav-panel"> <p> Next: <a href="#Obtaining-and-Building-GRUB" accesskey="n" rel="next">How to obtain and build GRUB</a>, Previous: <a href="#Troubleshooting" accesskey="p" rel="prev">Error messages produced by GRUB</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="chapter" id="User_002dspace-utilities-1"><span>24 User-space utilities<a class="copiable-link" href="#User_002dspace-utilities-1"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#Invoking-grub2_002dinstall" accesskey="1">Invoking grub2-install</a></li> <li><a href="#Invoking-grub2_002dmkconfig" accesskey="2">Invoking grub2-mkconfig</a></li> <li><a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2" accesskey="3">Invoking grub2-mkpasswd-pbkdf2</a></li> <li><a href="#Invoking-grub2_002dmkrelpath" accesskey="4">Invoking grub2-mkrelpath</a></li> <li><a href="#Invoking-grub2_002dmkrescue" accesskey="5">Invoking grub2-mkrescue</a></li> <li><a href="#Invoking-grub2_002dmount" accesskey="6">Invoking grub2-mount</a></li> <li><a href="#Invoking-grub2_002dprobe" accesskey="7">Invoking grub2-probe</a></li> <li><a href="#Invoking-grub2_002dscript_002dcheck" accesskey="8">Invoking grub2-script-check</a></li> </ul> <hr> <div class="section-level-extent" id="Invoking-grub2_002dinstall"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dmkconfig" accesskey="n" rel="next">Invoking grub2-mkconfig</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dinstall-1"><span>24.1 Invoking grub2-install<a class="copiable-link" href="#Invoking-grub2_002dinstall-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-install</code> generates a GRUB core image using <code class="command">grub2-mkimage</code> and installs it on your system. You must specify the device name on which you want to install GRUB, like this: </p> <div class="example"> <pre class="example-preformatted">grub2-install <var class="var">install_device</var> </pre></div> <p>The device name <var class="var">install_device</var> is an OS device name or a GRUB device name. </p> <p>In order to support UEFI Secure Boot, the resulting GRUB EFI binary must be signed by a recognized private key. For this reason, for EFI platforms, most distributions also ship prebuilt GRUB EFI binaries signed by a distribution-specific private key. In this case, however, <code class="command">grub2-install</code> should not be used because it would overwrite the signed EFI binary. </p> <p><code class="command">grub2-install</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">--boot-directory=<var class="var">dir</var></samp></dt> <dd><p>Install GRUB images under the directory <samp class="file"><var class="var">dir</var>/grub/</samp> This option is useful when you want to install GRUB into a separate partition or a removable disk. If this option is not specified then it defaults to <samp class="file">/boot</samp>, so </p> <div class="example"> <pre class="example-preformatted"><kbd class="kbd">grub2-install /dev/sda</kbd> </pre></div> <p>is equivalent to </p> <div class="example"> <pre class="example-preformatted"><kbd class="kbd">grub2-install --boot-directory=/boot/ /dev/sda</kbd> </pre></div> <p>Here is an example in which you have a separate <em class="dfn">boot</em> partition which is mounted on <samp class="file">/mnt/boot</samp>: </p> <div class="example"> <pre class="example-preformatted"><kbd class="kbd">grub2-install --boot-directory=/mnt/boot /dev/sdb</kbd> </pre></div> </dd> <dt><samp class="option">--recheck</samp></dt> <dd><p>Recheck the device map, even if <samp class="file">/boot/grub2/device.map</samp> already exists. You should use this option whenever you add/remove a disk into/from your computer. </p> </dd> <dt><samp class="option">--no-rs-codes</samp></dt> <dd><p>By default on x86 BIOS systems, <code class="command">grub2-install</code> will use some extra space in the bootloader embedding area for Reed-Solomon error-correcting codes. This enables GRUB to still boot successfully if some blocks are corrupted. The exact amount of protection offered is dependent on available space in the embedding area. R sectors of redundancy can tolerate up to R/2 corrupted sectors. This redundancy may be cumbersome if attempting to cryptographically validate the contents of the bootloader embedding area, or in more modern systems with GPT-style partition tables (see <a class="pxref" href="#BIOS-installation">BIOS installation</a>) where GRUB does not reside in any unpartitioned space outside of the MBR. Disable the Reed-Solomon codes with this option. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dmkconfig"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2" accesskey="n" rel="next">Invoking grub2-mkpasswd-pbkdf2</a>, Previous: <a href="#Invoking-grub2_002dinstall" accesskey="p" rel="prev">Invoking grub2-install</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dmkconfig-1"><span>24.2 Invoking grub2-mkconfig<a class="copiable-link" href="#Invoking-grub2_002dmkconfig-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-mkconfig</code> generates a configuration file for GRUB (see <a class="pxref" href="#Simple-configuration">Simple configuration handling</a>). </p> <div class="example"> <pre class="example-preformatted">grub2-mkconfig -o /boot/grub2/grub.cfg </pre></div> <p><code class="command">grub2-mkconfig</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">-o <var class="var">file</var></samp></dt> <dt><samp class="option">--output=<var class="var">file</var></samp></dt> <dd><p>Send the generated configuration file to <var class="var">file</var>. The default is to send it to standard output. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dmkpasswd_002dpbkdf2"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dmkrelpath" accesskey="n" rel="next">Invoking grub2-mkrelpath</a>, Previous: <a href="#Invoking-grub2_002dmkconfig" accesskey="p" rel="prev">Invoking grub2-mkconfig</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dmkpasswd_002dpbkdf2-1"><span>24.3 Invoking grub2-mkpasswd-pbkdf2<a class="copiable-link" href="#Invoking-grub2_002dmkpasswd_002dpbkdf2-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-mkpasswd-pbkdf2</code> generates password hashes for GRUB (see <a class="pxref" href="#Security">Security</a>). </p> <div class="example"> <pre class="example-preformatted">grub2-mkpasswd-pbkdf2 </pre></div> <p><code class="command">grub2-mkpasswd-pbkdf2</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">-c <var class="var">number</var></samp></dt> <dt><samp class="option">--iteration-count=<var class="var">number</var></samp></dt> <dd><p>Number of iterations of the underlying pseudo-random function. Defaults to 10000. </p> </dd> <dt><samp class="option">-l <var class="var">number</var></samp></dt> <dt><samp class="option">--buflen=<var class="var">number</var></samp></dt> <dd><p>Length of the generated hash. Defaults to 64. </p> </dd> <dt><samp class="option">-s <var class="var">number</var></samp></dt> <dt><samp class="option">--salt=<var class="var">number</var></samp></dt> <dd><p>Length of the salt. Defaults to 64. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dmkrelpath"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dmkrescue" accesskey="n" rel="next">Invoking grub2-mkrescue</a>, Previous: <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2" accesskey="p" rel="prev">Invoking grub2-mkpasswd-pbkdf2</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dmkrelpath-1"><span>24.4 Invoking grub2-mkrelpath<a class="copiable-link" href="#Invoking-grub2_002dmkrelpath-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-mkrelpath</code> makes a file system path relative to the root of its containing file system. For instance, if <samp class="file">/usr</samp> is a mount point, then: </p> <div class="example"> <pre class="example-preformatted">$ <kbd class="kbd">grub2-mkrelpath /usr/share/grub/unicode.pf2</kbd> ‘<samp class="samp">/share/grub/unicode.pf2</samp>’ </pre></div> <p>This is mainly used internally by other GRUB utilities such as <code class="command">grub2-mkconfig</code> (see <a class="pxref" href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>), but may occasionally also be useful for debugging. </p> <p><code class="command">grub2-mkrelpath</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dmkrescue"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dmount" accesskey="n" rel="next">Invoking grub2-mount</a>, Previous: <a href="#Invoking-grub2_002dmkrelpath" accesskey="p" rel="prev">Invoking grub2-mkrelpath</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dmkrescue-1"><span>24.5 Invoking grub2-mkrescue<a class="copiable-link" href="#Invoking-grub2_002dmkrescue-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-mkrescue</code> generates a bootable GRUB rescue image (see <a class="pxref" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>). </p> <div class="example"> <pre class="example-preformatted">grub2-mkrescue -o grub.iso </pre></div> <p>All arguments not explicitly listed as <code class="command">grub2-mkrescue</code> options are passed on directly to <code class="command">xorriso</code> in <code class="command">mkisofs</code> emulation mode. Options passed to <code class="command">xorriso</code> will normally be interpreted as <code class="command">mkisofs</code> options; if the option ‘<samp class="samp">--</samp>’ is used, then anything after that will be interpreted as native <code class="command">xorriso</code> options. </p> <p>Non-option arguments specify additional source directories. This is commonly used to add extra files to the image: </p> <div class="example"> <pre class="example-preformatted">mkdir -p disk/boot/grub <span class="r">(add extra files to <samp class="file">disk/boot/grub</samp>)</span> grub2-mkrescue -o grub.iso disk </pre></div> <p><code class="command">grub2-mkrescue</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">-o <var class="var">file</var></samp></dt> <dt><samp class="option">--output=<var class="var">file</var></samp></dt> <dd><p>Save output in <var class="var">file</var>. This "option" is required. </p> </dd> <dt><samp class="option">--modules=<var class="var">modules</var></samp></dt> <dd><p>Pre-load the named GRUB modules in the image. Multiple entries in <var class="var">modules</var> should be separated by whitespace (so you will probably need to quote this for your shell). </p> </dd> <dt><samp class="option">--rom-directory=<var class="var">dir</var></samp></dt> <dd><p>If generating images for the QEMU or Coreboot platforms, copy the resulting <samp class="file">qemu.img</samp> or <samp class="file">coreboot.elf</samp> files respectively to the <var class="var">dir</var> directory as well as including them in the image. </p> </dd> <dt><samp class="option">--xorriso=<var class="var">file</var></samp></dt> <dd><p>Use <var class="var">file</var> as the <code class="command">xorriso</code> program, rather than the built-in default. </p> </dd> <dt><samp class="option">--grub-mkimage=<var class="var">file</var></samp></dt> <dd><p>Use <var class="var">file</var> as the <code class="command">grub2-mkimage</code> program, rather than the built-in default. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dmount"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dprobe" accesskey="n" rel="next">Invoking grub2-probe</a>, Previous: <a href="#Invoking-grub2_002dmkrescue" accesskey="p" rel="prev">Invoking grub2-mkrescue</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dmount-1"><span>24.6 Invoking grub2-mount<a class="copiable-link" href="#Invoking-grub2_002dmount-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-mount</code> performs a read-only mount of any file system or file system image that GRUB understands, using GRUB’s file system drivers via FUSE. (It is only available if FUSE development files were present when GRUB was built.) This has a number of uses: </p> <ul class="itemize mark-bullet"> <li>It provides a convenient way to check how GRUB will view a file system at boot time. You can use normal command-line tools to compare that view with that of your operating system, making it easy to find bugs. </li><li>It offers true read-only mounts. Linux does not have these for journalling file systems, because it will always attempt to replay the journal at mount time; while you can temporarily mark the block device read-only to avoid this, that causes the mount to fail. Since GRUB intentionally contains no code for writing to file systems, it can easily provide a guaranteed read-only mount mechanism. </li><li>It allows you to examine any file system that GRUB understands without needing to load additional modules into your running kernel, which may be useful in constrained environments such as installers. </li><li>Since it can examine file system images (contained in regular files) just as easily as file systems on block devices, you can use it to inspect any file system image that GRUB understands with only enough privileges to use FUSE, even if nobody has yet written a FUSE module specifically for that file system type. </li></ul> <p>Using <code class="command">grub2-mount</code> is normally as simple as: </p> <div class="example"> <pre class="example-preformatted">grub2-mount /dev/sda1 /mnt </pre></div> <p><code class="command">grub2-mount</code> must be given one or more images and a mount point as non-option arguments (if it is given more than one image, it will treat them as a RAID set), and also accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">-C</samp></dt> <dt><samp class="option">--crypto</samp></dt> <dd><p>Mount encrypted devices, prompting for a passphrase if necessary. </p> </dd> <dt><samp class="option">-d <var class="var">string</var></samp></dt> <dt><samp class="option">--debug=<var class="var">string</var></samp></dt> <dd><p>Show debugging output for conditions matching <var class="var">string</var>. </p> </dd> <dt><samp class="option">-K prompt|<var class="var">file</var></samp></dt> <dt><samp class="option">--zfs-key=prompt|<var class="var">file</var></samp></dt> <dd><p>Load a ZFS encryption key. If you use ‘<samp class="samp">prompt</samp>’ as the argument, <code class="command">grub2-mount</code> will read a passphrase from the terminal; otherwise, it will read key material from the specified file. </p> </dd> <dt><samp class="option">-r <var class="var">device</var></samp></dt> <dt><samp class="option">--root=<var class="var">device</var></samp></dt> <dd><p>Set the GRUB root device to <var class="var">device</var>. You do not normally need to set this; <code class="command">grub2-mount</code> will automatically set the root device to the root of the supplied file system. </p> <p>If <var class="var">device</var> is just a number, then it will be treated as a partition number within the supplied image. This means that, if you have an image of an entire disk in <samp class="file">disk.img</samp>, then you can use this command to mount its second partition: </p> <div class="example"> <pre class="example-preformatted">grub2-mount -r 2 disk.img mount-point </pre></div> </dd> <dt><samp class="option">-v</samp></dt> <dt><samp class="option">--verbose</samp></dt> <dd><p>Print verbose messages. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dprobe"> <div class="nav-panel"> <p> Next: <a href="#Invoking-grub2_002dscript_002dcheck" accesskey="n" rel="next">Invoking grub2-script-check</a>, Previous: <a href="#Invoking-grub2_002dmount" accesskey="p" rel="prev">Invoking grub2-mount</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dprobe-1"><span>24.7 Invoking grub2-probe<a class="copiable-link" href="#Invoking-grub2_002dprobe-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-probe</code> probes device information for a given path or device. </p> <div class="example"> <pre class="example-preformatted">grub2-probe --target=fs /boot/grub grub2-probe --target=drive --device /dev/sda1 </pre></div> <p><code class="command">grub2-probe</code> must be given a path or device as a non-option argument, and also accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">-d</samp></dt> <dt><samp class="option">--device</samp></dt> <dd><p>If this option is given, then the non-option argument is a system device name (such as ‘<samp class="samp">/dev/sda1</samp>’), and <code class="command">grub2-probe</code> will print information about that device. If it is not given, then the non-option argument is a filesystem path (such as ‘<samp class="samp">/boot/grub</samp>’), and <code class="command">grub2-probe</code> will print information about the device containing that part of the filesystem. </p> </dd> <dt><samp class="option">-m <var class="var">file</var></samp></dt> <dt><samp class="option">--device-map=<var class="var">file</var></samp></dt> <dd><p>Use <var class="var">file</var> as the device map (see <a class="pxref" href="#Device-map">The map between BIOS drives and OS devices</a>) rather than the default, usually ‘<samp class="samp">/boot/grub2/device.map</samp>’. </p> </dd> <dt><samp class="option">-t <var class="var">target</var></samp></dt> <dt><samp class="option">--target=<var class="var">target</var></samp></dt> <dd><p>Print information about the given path or device as defined by <var class="var">target</var>. The available targets and their meanings are: </p> <dl class="table"> <dt>‘<samp class="samp">fs</samp>’</dt> <dd><p>GRUB filesystem module. </p></dd> <dt>‘<samp class="samp">fs_uuid</samp>’</dt> <dd><p>Filesystem Universally Unique Identifier (UUID). </p></dd> <dt>‘<samp class="samp">fs_label</samp>’</dt> <dd><p>Filesystem label. </p></dd> <dt>‘<samp class="samp">drive</samp>’</dt> <dd><p>GRUB device name. </p></dd> <dt>‘<samp class="samp">device</samp>’</dt> <dd><p>System device name. </p></dd> <dt>‘<samp class="samp">partmap</samp>’</dt> <dd><p>GRUB partition map module. </p></dd> <dt>‘<samp class="samp">abstraction</samp>’</dt> <dd><p>GRUB abstraction module (e.g. ‘<samp class="samp">lvm</samp>’). </p></dd> <dt>‘<samp class="samp">cryptodisk_uuid</samp>’</dt> <dd><p>Crypto device UUID. </p></dd> <dt>‘<samp class="samp">msdos_parttype</samp>’</dt> <dd><p>MBR partition type code (two hexadecimal digits). </p></dd> <dt>‘<samp class="samp">hints_string</samp>’</dt> <dd><p>A string of platform search hints suitable for passing to the <code class="command">search</code> command (see <a class="pxref" href="#search">search</a>). </p></dd> <dt>‘<samp class="samp">bios_hints</samp>’</dt> <dd><p>Search hints for the PC BIOS platform. </p></dd> <dt>‘<samp class="samp">ieee1275_hints</samp>’</dt> <dd><p>Search hints for the IEEE1275 platform. </p></dd> <dt>‘<samp class="samp">baremetal_hints</samp>’</dt> <dd><p>Search hints for platforms where disks are addressed directly rather than via firmware. </p></dd> <dt>‘<samp class="samp">efi_hints</samp>’</dt> <dd><p>Search hints for the EFI platform. </p></dd> <dt>‘<samp class="samp">arc_hints</samp>’</dt> <dd><p>Search hints for the ARC platform. </p></dd> <dt>‘<samp class="samp">compatibility_hint</samp>’</dt> <dd><p>A guess at a reasonable GRUB drive name for this device, which may be used as a fallback if the <code class="command">search</code> command fails. </p></dd> <dt>‘<samp class="samp">disk</samp>’</dt> <dd><p>System device name for the whole disk. </p></dd> </dl> </dd> <dt><samp class="option">-v</samp></dt> <dt><samp class="option">--verbose</samp></dt> <dd><p>Print verbose messages. </p></dd> </dl> <hr> </div> <div class="section-level-extent" id="Invoking-grub2_002dscript_002dcheck"> <div class="nav-panel"> <p> Previous: <a href="#Invoking-grub2_002dprobe" accesskey="p" rel="prev">Invoking grub2-probe</a>, Up: <a href="#User_002dspace-utilities" accesskey="u" rel="up">User-space utilities</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="section" id="Invoking-grub2_002dscript_002dcheck-1"><span>24.8 Invoking grub2-script-check<a class="copiable-link" href="#Invoking-grub2_002dscript_002dcheck-1"> ¶</a></span></h3> <p>The program <code class="command">grub2-script-check</code> takes a GRUB script file (see <a class="pxref" href="#Shell_002dlike-scripting">Writing full configuration files directly</a>) and checks it for syntax errors, similar to commands such as <code class="command">sh -n</code>. It may take a <var class="var">path</var> as a non-option argument; if none is supplied, it will read from standard input. </p> <div class="example"> <pre class="example-preformatted">grub2-script-check /boot/grub2/grub.cfg </pre></div> <p><code class="command">grub2-script-check</code> accepts the following options: </p> <dl class="table"> <dt><samp class="option">--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp class="option">--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp class="option">-v</samp></dt> <dt><samp class="option">--verbose</samp></dt> <dd><p>Print each line of input after reading it. </p></dd> </dl> <hr> </div> </div> <div class="appendix-level-extent" id="Obtaining-and-Building-GRUB"> <div class="nav-panel"> <p> Next: <a href="#Reporting-bugs" accesskey="n" rel="next">Reporting bugs</a>, Previous: <a href="#User_002dspace-utilities" accesskey="p" rel="prev">User-space utilities</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="appendix" id="How-to-obtain-and-build-GRUB"><span>Appendix A How to obtain and build GRUB<a class="copiable-link" href="#How-to-obtain-and-build-GRUB"> ¶</a></span></h2> <blockquote class="quotation"> <p><strong class="strong">Caution:</strong> GRUB requires binutils-2.9.1.0.23 or later because the GNU assembler has been changed so that it can produce real 16bits machine code between 2.9.1 and 2.9.1.0.x. See <a class="uref" href="http://sources.redhat.com/binutils/">http://sources.redhat.com/binutils/</a>, to obtain information on how to get the latest version. </p></blockquote> <p>GRUB is available from the GNU alpha archive site <a class="uref" href="ftp://ftp.gnu.org/gnu/grub">ftp://ftp.gnu.org/gnu/grub</a> or any of its mirrors. The file will be named grub-version.tar.gz. The current version is 2.12, so the file you should grab is: </p> <p><a class="uref" href="ftp://ftp.gnu.org/gnu/grub/grub-2.12.tar.gz">ftp://ftp.gnu.org/gnu/grub/grub-2.12.tar.gz</a> </p> <p>To unbundle GRUB use the instruction: </p> <div class="example"> <pre class="example-preformatted"><kbd class="kbd">zcat grub-2.12.tar.gz | tar xvf -</kbd> </pre></div> <p>which will create a directory called <samp class="file">grub-2.12</samp> with all the sources. You can look at the file <samp class="file">INSTALL</samp> for detailed instructions on how to build and install GRUB, but you should be able to just do: </p> <div class="example"> <div class="group"><pre class="example-preformatted"><kbd class="kbd">cd grub-2.12</kbd> <kbd class="kbd">./configure</kbd> <kbd class="kbd">make install</kbd> </pre></div></div> <p>Also, the latest version is available using Git. See <a class="uref" href="http://www.gnu.org/software/grub/grub-download.html">http://www.gnu.org/software/grub/grub-download.html</a> for more information. </p> <hr> </div> <div class="appendix-level-extent" id="Reporting-bugs"> <div class="nav-panel"> <p> Next: <a href="#Future" accesskey="n" rel="next">Where GRUB will go</a>, Previous: <a href="#Obtaining-and-Building-GRUB" accesskey="p" rel="prev">How to obtain and build GRUB</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="appendix" id="Reporting-bugs-1"><span>Appendix B Reporting bugs<a class="copiable-link" href="#Reporting-bugs-1"> ¶</a></span></h2> <p>These are the guideline for how to report bugs. Take a look at this list below before you submit bugs: </p> <ol class="enumerate"> <li> Before getting unsettled, read this manual through and through. Also, see the <a class="uref" href="http://www.gnu.org/software/grub/grub-faq.html">GNU GRUB FAQ</a>. </li><li> Always mention the information on your GRUB. The version number and the configuration are quite important. If you build it yourself, write the options specified to the configure script and your operating system, including the versions of gcc and binutils. </li><li> If you have trouble with the installation, inform us of how you installed GRUB. Don’t omit error messages, if any. Just ‘<samp class="samp">GRUB hangs up when it boots</samp>’ is not enough. <p>The information on your hardware is also essential. These are especially important: the geometries and the partition tables of your hard disk drives and your BIOS. </p> </li><li> If GRUB cannot boot your operating system, write down <em class="emph">everything</em> you see on the screen. Don’t paraphrase them, like ‘<samp class="samp">The foo OS crashes with GRUB, even though it can boot with the bar boot loader just fine</samp>’. Mention the commands you executed, the messages printed by them, and information on your operating system including the version number. </li><li> Explain what you wanted to do. It is very useful to know your purpose and your wish, and how GRUB didn’t satisfy you. </li><li> If you can investigate the problem yourself, please do. That will give you and us much more information on the problem. Attaching a patch is even better. <p>When you attach a patch, make the patch in unified diff format, and write ChangeLog entries. But, even when you make a patch, don’t forget to explain the problem, so that we can understand what your patch is for. </p> </li><li> Write down anything that you think might be related. Please understand that we often need to reproduce the same problem you encountered in our environment. So your information should be sufficient for us to do the same thing—Don’t forget that we cannot see your computer directly. If you are not sure whether to state a fact or leave it out, state it! Reporting too many things is much better than omitting something important. </li></ol> <p>If you follow the guideline above, submit a report to the <a class="uref" href="http://savannah.gnu.org/bugs/?group=grub">Bug Tracking System</a>. Alternatively, you can submit a report via electronic mail to <a class="email" href="mailto:bug-grub@gnu.org">bug-grub@gnu.org</a>, but we strongly recommend that you use the Bug Tracking System, because e-mail can be passed over easily. </p> <p>Once we get your report, we will try to fix the bugs. </p> <hr> </div> <div class="appendix-level-extent" id="Future"> <div class="nav-panel"> <p> Next: <a href="#Copying-This-Manual" accesskey="n" rel="next">Copying This Manual</a>, Previous: <a href="#Reporting-bugs" accesskey="p" rel="prev">Reporting bugs</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="appendix" id="Where-GRUB-will-go"><span>Appendix C Where GRUB will go<a class="copiable-link" href="#Where-GRUB-will-go"> ¶</a></span></h2> <p>GRUB 2 is now quite stable and used in many production systems. We are currently working towards a 2.0 release. </p> <p>If you are interested in the development of GRUB 2, take a look at <a class="uref" href="http://www.gnu.org/software/grub/grub.html">the homepage</a>. </p> <hr> </div> <div class="appendix-level-extent" id="Copying-This-Manual"> <div class="nav-panel"> <p> Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Future" accesskey="p" rel="prev">Where GRUB will go</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="appendix" id="Copying-This-Manual-1"><span>Appendix D Copying This Manual<a class="copiable-link" href="#Copying-This-Manual-1"> ¶</a></span></h2> <ul class="mini-toc"> <li><a href="#GNU-Free-Documentation-License" accesskey="1">GNU Free Documentation License</a></li> </ul> <hr> <div class="appendixsec-level-extent" id="GNU-Free-Documentation-License"> <div class="nav-panel"> <p> Up: <a href="#Copying-This-Manual" accesskey="u" rel="up">Copying This Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h3 class="appendixsec" id="GNU-Free-Documentation-License-1"><span>D.1 GNU Free Documentation License<a class="copiable-link" href="#GNU-Free-Documentation-License-1"> ¶</a></span></h3> <a class="index-entry-id" id="index-FDL_002c-GNU-Free-Documentation-License"></a> <div class="center">Version 1.2, November 2002 </div> <div class="display"> <pre class="display-preformatted">Copyright © 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. </pre></div> <ol class="enumerate" start="0"> <li> PREAMBLE <p>The purpose of this License is to make a manual, textbook, or other functional and useful document <em class="dfn">free</em> in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. </p> <p>This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. </p> <p>We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. </p> </li><li> APPLICABILITY AND DEFINITIONS <p>This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. </p> <p>A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. </p> <p>A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. </p> <p>The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. </p> <p>The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. </p> <p>A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”. </p> <p>Examples of suitable formats for Transparent copies include plain <small class="sc">ASCII</small> without markup, Texinfo input format, LaTeX input format, <abbr class="acronym">SGML</abbr> or <abbr class="acronym">XML</abbr> using a publicly available <abbr class="acronym">DTD</abbr>, and standard-conforming simple <abbr class="acronym">HTML</abbr>, PostScript or <abbr class="acronym">PDF</abbr> designed for human modification. Examples of transparent image formats include <abbr class="acronym">PNG</abbr>, <abbr class="acronym">XCF</abbr> and <abbr class="acronym">JPG</abbr>. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, <abbr class="acronym">SGML</abbr> or <abbr class="acronym">XML</abbr> for which the <abbr class="acronym">DTD</abbr> and/or processing tools are not generally available, and the machine-generated <abbr class="acronym">HTML</abbr>, PostScript or <abbr class="acronym">PDF</abbr> produced by some word processors for output purposes only. </p> <p>The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. </p> <p>A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition. </p> <p>The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. </p> </li><li> VERBATIM COPYING <p>You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. </p> <p>You may also lend copies, under the same conditions stated above, and you may publicly display copies. </p> </li><li> COPYING IN QUANTITY <p>If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. </p> <p>If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. </p> <p>If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. </p> <p>It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. </p> </li><li> MODIFICATIONS <p>You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: </p> <ol class="enumerate" type="A" start="1"> <li> Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. </li><li> List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. </li><li> State on the Title page the name of the publisher of the Modified Version, as the publisher. </li><li> Preserve all the copyright notices of the Document. </li><li> Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. </li><li> Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. </li><li> Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. </li><li> Include an unaltered copy of this License. </li><li> Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. </li><li> Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. </li><li> For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. </li><li> Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. </li><li> Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version. </li><li> Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section. </li><li> Preserve any Warranty Disclaimers. </li></ol> <p>If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. </p> <p>You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. </p> <p>You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. </p> <p>The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. </p> </li><li> COMBINING DOCUMENTS <p>You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. </p> <p>The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. </p> <p>In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.” </p> </li><li> COLLECTIONS OF DOCUMENTS <p>You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. </p> <p>You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. </p> </li><li> AGGREGATION WITH INDEPENDENT WORKS <p>A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. </p> <p>If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. </p> </li><li> TRANSLATION <p>Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. </p> <p>If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. </p> </li><li> TERMINATION <p>You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p> </li><li> FUTURE REVISIONS OF THIS LICENSE <p>The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See <a class="uref" href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>. </p> <p>Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. </p></li></ol> <ul class="mini-toc"> <li><a href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents" accesskey="1">ADDENDUM: How to use this License for your documents</a></li> </ul> <div class="appendixsubsec-level-extent" id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"> <h4 class="appendixsubsec"><span>D.1.1 ADDENDUM: How to use this License for your documents<a class="copiable-link" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents"> ¶</a></span></h4> <p>To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: </p> <div class="example smallexample"> <div class="group"><pre class="example-preformatted"> Copyright (C) <var class="var">year</var> <var class="var">your name</var>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. </pre></div></div> <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this: </p> <div class="example smallexample"> <div class="group"><pre class="example-preformatted"> with the Invariant Sections being <var class="var">list their titles</var>, with the Front-Cover Texts being <var class="var">list</var>, and with the Back-Cover Texts being <var class="var">list</var>. </pre></div></div> <p>If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. </p> <p>If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. </p> <hr> </div> </div> </div> <div class="unnumbered-level-extent" id="Index"> <div class="nav-panel"> <p> Previous: <a href="#Copying-This-Manual" accesskey="p" rel="prev">Copying This Manual</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU GRUB manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h2 class="unnumbered" id="Index-1"><span>Index<a class="copiable-link" href="#Index-1"> ¶</a></span></h2> <div class="printindex cp-printindex"> <table class="cp-letters-header-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Index_cp_symbol-1"><b>[</b></a> <br> <a class="summary-letter-printindex" href="#Index_cp_letter-A"><b>A</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-B"><b>B</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-C"><b>C</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-D"><b>D</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-E"><b>E</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-F"><b>F</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-G"><b>G</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-H"><b>H</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-I"><b>I</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-K"><b>K</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-L"><b>L</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-M"><b>M</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-N"><b>N</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-P"><b>P</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-R"><b>R</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-S"><b>S</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-T"><b>T</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-U"><b>U</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-V"><b>V</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-W"><b>W</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-X"><b>X</b></a> </td></tr></table> <table class="cp-entries-printindex" border="0"> <tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_symbol-1">[</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-_005b"><code><code class="code">[</code></code></a></td><td class="printindex-index-section"><a href="#g_t_005b">[</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-A">A</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-acpi"><code>acpi</code></a></td><td class="printindex-index-section"><a href="#acpi">acpi</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-authenticate"><code>authenticate</code></a></td><td class="printindex-index-section"><a href="#authenticate">authenticate</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-B">B</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-background_005fcolor"><code>background_color</code></a></td><td class="printindex-index-section"><a href="#background_005fcolor">background_color</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-background_005fimage"><code>background_image</code></a></td><td class="printindex-index-section"><a href="#background_005fimage">background_image</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-badram"><code>badram</code></a></td><td class="printindex-index-section"><a href="#badram">badram</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-blocklist"><code>blocklist</code></a></td><td class="printindex-index-section"><a href="#blocklist">blocklist</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-boot"><code>boot</code></a></td><td class="printindex-index-section"><a href="#boot">boot</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-C">C</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cat"><code>cat</code></a></td><td class="printindex-index-section"><a href="#cat">cat</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-chainloader"><code>chainloader</code></a></td><td class="printindex-index-section"><a href="#chainloader">chainloader</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-clear"><code>clear</code></a></td><td class="printindex-index-section"><a href="#clear">clear</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-CMOS"><code>CMOS</code></a></td><td class="printindex-index-section"><a href="#cmosdump">cmosdump</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cmosclean"><code>cmosclean</code></a></td><td class="printindex-index-section"><a href="#cmosclean">cmosclean</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cmostest"><code>cmostest</code></a></td><td class="printindex-index-section"><a href="#cmostest">cmostest</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cmp"><code>cmp</code></a></td><td class="printindex-index-section"><a href="#cmp">cmp</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-configfile"><code>configfile</code></a></td><td class="printindex-index-section"><a href="#configfile">configfile</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cpuid"><code>cpuid</code></a></td><td class="printindex-index-section"><a href="#cpuid">cpuid</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-crc"><code>crc</code></a></td><td class="printindex-index-section"><a href="#crc">crc</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cryptomount"><code>cryptomount</code></a></td><td class="printindex-index-section"><a href="#cryptomount">cryptomount</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-cutmem"><code>cutmem</code></a></td><td class="printindex-index-section"><a href="#cutmem">cutmem</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-D">D</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-date"><code>date</code></a></td><td class="printindex-index-section"><a href="#date">date</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-devicetree"><code>devicetree</code></a></td><td class="printindex-index-section"><a href="#devicetree">devicetree</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-distrust"><code>distrust</code></a></td><td class="printindex-index-section"><a href="#distrust">distrust</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-distrust_005fcertificate"><code>distrust_certificate</code></a></td><td class="printindex-index-section"><a href="#distrust_005fcertificate">distrust_certificate</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-drivemap"><code>drivemap</code></a></td><td class="printindex-index-section"><a href="#drivemap">drivemap</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-E">E</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-echo"><code>echo</code></a></td><td class="printindex-index-section"><a href="#echo">echo</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-efitextmode"><code>efitextmode</code></a></td><td class="printindex-index-section"><a href="#efitextmode">efitextmode</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-eval"><code>eval</code></a></td><td class="printindex-index-section"><a href="#eval">eval</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-export"><code>export</code></a></td><td class="printindex-index-section"><a href="#export">export</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-F">F</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-false"><code>false</code></a></td><td class="printindex-index-section"><a href="#false">false</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-FDL_002c-GNU-Free-Documentation-License">FDL, GNU Free Documentation License</a></td><td class="printindex-index-section"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-fwsetup"><code>fwsetup</code></a></td><td class="printindex-index-section"><a href="#fwsetup">fwsetup</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-G">G</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-gdbinfo"><code>gdbinfo</code></a></td><td class="printindex-index-section"><a href="#gdbinfo">gdbinfo</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-gettext"><code>gettext</code></a></td><td class="printindex-index-section"><a href="#gettext">gettext</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-gptsync"><code>gptsync</code></a></td><td class="printindex-index-section"><a href="#gptsync">gptsync</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-H">H</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-halt"><code>halt</code></a></td><td class="printindex-index-section"><a href="#halt">halt</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-hashsum"><code>hashsum</code></a></td><td class="printindex-index-section"><a href="#hashsum">hashsum</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-help"><code>help</code></a></td><td class="printindex-index-section"><a href="#help">help</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-hexdump"><code>hexdump</code></a></td><td class="printindex-index-section"><a href="#hexdump">hexdump</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-I">I</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-initrd"><code>initrd</code></a></td><td class="printindex-index-section"><a href="#initrd">initrd</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-initrd16"><code>initrd16</code></a></td><td class="printindex-index-section"><a href="#initrd16">initrd16</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-insmod"><code>insmod</code></a></td><td class="printindex-index-section"><a href="#insmod">insmod</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-K">K</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-keystatus"><code>keystatus</code></a></td><td class="printindex-index-section"><a href="#keystatus">keystatus</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-L">L</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-linux"><code>linux</code></a></td><td class="printindex-index-section"><a href="#linux">linux</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-linux16"><code>linux16</code></a></td><td class="printindex-index-section"><a href="#linux16">linux16</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-list_005fcertificates"><code>list_certificates</code></a></td><td class="printindex-index-section"><a href="#list_005fcertificates">list_certificates</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-list_005fenv"><code>list_env</code></a></td><td class="printindex-index-section"><a href="#list_005fenv">list_env</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-list_005ftrusted"><code>list_trusted</code></a></td><td class="printindex-index-section"><a href="#list_005ftrusted">list_trusted</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-loadfont"><code>loadfont</code></a></td><td class="printindex-index-section"><a href="#loadfont">loadfont</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-load_005fenv"><code>load_env</code></a></td><td class="printindex-index-section"><a href="#load_005fenv">load_env</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-loopback"><code>loopback</code></a></td><td class="printindex-index-section"><a href="#loopback">loopback</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-ls"><code>ls</code></a></td><td class="printindex-index-section"><a href="#ls">ls</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-lsfonts"><code>lsfonts</code></a></td><td class="printindex-index-section"><a href="#lsfonts">lsfonts</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-lsmod"><code>lsmod</code></a></td><td class="printindex-index-section"><a href="#lsmod">lsmod</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-M">M</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-md5sum"><code>md5sum</code></a></td><td class="printindex-index-section"><a href="#md5sum">md5sum</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-menuentry"><code>menuentry</code></a></td><td class="printindex-index-section"><a href="#menuentry">menuentry</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-module"><code>module</code></a></td><td class="printindex-index-section"><a href="#module">module</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-multiboot"><code>multiboot</code></a></td><td class="printindex-index-section"><a href="#multiboot">multiboot</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-N">N</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-nativedisk"><code>nativedisk</code></a></td><td class="printindex-index-section"><a href="#nativedisk">nativedisk</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fadd_005faddr"><code>net_add_addr</code></a></td><td class="printindex-index-section"><a href="#net_005fadd_005faddr">net_add_addr</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fadd_005fdns"><code>net_add_dns</code></a></td><td class="printindex-index-section"><a href="#net_005fadd_005fdns">net_add_dns</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fadd_005froute"><code>net_add_route</code></a></td><td class="printindex-index-section"><a href="#net_005fadd_005froute">net_add_route</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fbootp"><code>net_bootp</code></a></td><td class="printindex-index-section"><a href="#net_005fbootp">net_bootp</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fbootp6"><code>net_bootp6</code></a></td><td class="printindex-index-section"><a href="#net_005fbootp6">net_bootp6</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fdel_005faddr"><code>net_del_addr</code></a></td><td class="printindex-index-section"><a href="#net_005fdel_005faddr">net_del_addr</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fdel_005fdns"><code>net_del_dns</code></a></td><td class="printindex-index-section"><a href="#net_005fdel_005fdns">net_del_dns</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fdel_005froute"><code>net_del_route</code></a></td><td class="printindex-index-section"><a href="#net_005fdel_005froute">net_del_route</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fdhcp"><code>net_dhcp</code></a></td><td class="printindex-index-section"><a href="#net_005fdhcp">net_dhcp</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fget_005fdhcp_005foption"><code>net_get_dhcp_option</code></a></td><td class="printindex-index-section"><a href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fipv6_005fautoconf"><code>net_ipv6_autoconf</code></a></td><td class="printindex-index-section"><a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fls_005faddr"><code>net_ls_addr</code></a></td><td class="printindex-index-section"><a href="#net_005fls_005faddr">net_ls_addr</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fls_005fcards"><code>net_ls_cards</code></a></td><td class="printindex-index-section"><a href="#net_005fls_005fcards">net_ls_cards</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fls_005fdns"><code>net_ls_dns</code></a></td><td class="printindex-index-section"><a href="#net_005fls_005fdns">net_ls_dns</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fls_005froutes"><code>net_ls_routes</code></a></td><td class="printindex-index-section"><a href="#net_005fls_005froutes">net_ls_routes</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fnslookup"><code>net_nslookup</code></a></td><td class="printindex-index-section"><a href="#net_005fnslookup">net_nslookup</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-net_005fset_005fvlan"><code>net_set_vlan</code></a></td><td class="printindex-index-section"><a href="#net_005fset_005fvlan">net_set_vlan</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-normal"><code>normal</code></a></td><td class="printindex-index-section"><a href="#normal">normal</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-normal_005fexit"><code>normal_exit</code></a></td><td class="printindex-index-section"><a href="#normal_005fexit">normal_exit</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-P">P</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-parttool"><code>parttool</code></a></td><td class="printindex-index-section"><a href="#parttool">parttool</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-password"><code>password</code></a></td><td class="printindex-index-section"><a href="#password">password</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-password_005fpbkdf2"><code>password_pbkdf2</code></a></td><td class="printindex-index-section"><a href="#password_005fpbkdf2">password_pbkdf2</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-plainmount"><code>plainmount</code></a></td><td class="printindex-index-section"><a href="#plainmount">plainmount</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-play"><code>play</code></a></td><td class="printindex-index-section"><a href="#play">play</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-probe"><code>probe</code></a></td><td class="printindex-index-section"><a href="#probe">probe</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-R">R</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-rdmsr"><code>rdmsr</code></a></td><td class="printindex-index-section"><a href="#rdmsr">rdmsr</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-read"><code>read</code></a></td><td class="printindex-index-section"><a href="#read">read</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-reboot"><code>reboot</code></a></td><td class="printindex-index-section"><a href="#reboot">reboot</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-regexp"><code>regexp</code></a></td><td class="printindex-index-section"><a href="#regexp">regexp</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-rmmod"><code>rmmod</code></a></td><td class="printindex-index-section"><a href="#rmmod">rmmod</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-S">S</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-save_005fenv"><code>save_env</code></a></td><td class="printindex-index-section"><a href="#save_005fenv">save_env</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-search"><code>search</code></a></td><td class="printindex-index-section"><a href="#search">search</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-sendkey"><code>sendkey</code></a></td><td class="printindex-index-section"><a href="#sendkey">sendkey</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-serial"><code>serial</code></a></td><td class="printindex-index-section"><a href="#serial">serial</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-set"><code>set</code></a></td><td class="printindex-index-section"><a href="#set">set</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-sha1sum"><code>sha1sum</code></a></td><td class="printindex-index-section"><a href="#sha1sum">sha1sum</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-sha256sum"><code>sha256sum</code></a></td><td class="printindex-index-section"><a href="#sha256sum">sha256sum</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-sha512sum"><code>sha512sum</code></a></td><td class="printindex-index-section"><a href="#sha512sum">sha512sum</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-sleep"><code>sleep</code></a></td><td class="printindex-index-section"><a href="#sleep">sleep</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-smbios"><code>smbios</code></a></td><td class="printindex-index-section"><a href="#smbios">smbios</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-source"><code>source</code></a></td><td class="printindex-index-section"><a href="#source">source</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-submenu"><code>submenu</code></a></td><td class="printindex-index-section"><a href="#submenu">submenu</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-T">T</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-terminal_005finput"><code>terminal_input</code></a></td><td class="printindex-index-section"><a href="#terminal_005finput">terminal_input</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-terminal_005foutput"><code>terminal_output</code></a></td><td class="printindex-index-section"><a href="#terminal_005foutput">terminal_output</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-terminfo"><code>terminfo</code></a></td><td class="printindex-index-section"><a href="#terminfo">terminfo</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-test"><code>test</code></a></td><td class="printindex-index-section"><a href="#test">test</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-true"><code>true</code></a></td><td class="printindex-index-section"><a href="#true">true</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-trust"><code>trust</code></a></td><td class="printindex-index-section"><a href="#trust">trust</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-trust_005fcertificate"><code>trust_certificate</code></a></td><td class="printindex-index-section"><a href="#trust_005fcertificate">trust_certificate</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-U">U</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-unset"><code>unset</code></a></td><td class="printindex-index-section"><a href="#unset">unset</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-V">V</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-verify_005fappended"><code>verify_appended</code></a></td><td class="printindex-index-section"><a href="#verify_005fappended">verify_appended</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-verify_005fdetached"><code>verify_detached</code></a></td><td class="printindex-index-section"><a href="#verify_005fdetached">verify_detached</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-videoinfo"><code>videoinfo</code></a></td><td class="printindex-index-section"><a href="#videoinfo">videoinfo</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-W">W</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-wrmsr"><code>wrmsr</code></a></td><td class="printindex-index-section"><a href="#wrmsr">wrmsr</a></td></tr> <tr><td colspan="3"><hr></td></tr> <tr><th id="Index_cp_letter-X">X</th></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-xen_005fhypervisor"><code>xen_hypervisor</code></a></td><td class="printindex-index-section"><a href="#xen_005fhypervisor">xen_hypervisor</a></td></tr> <tr><td></td><td class="printindex-index-entry"><a href="#index-xen_005fmodule"><code>xen_module</code></a></td><td class="printindex-index-section"><a href="#xen_005fmodule">xen_module</a></td></tr> <tr><td colspan="3"><hr></td></tr> </table> <table class="cp-letters-footer-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Index_cp_symbol-1"><b>[</b></a> <br> <a class="summary-letter-printindex" href="#Index_cp_letter-A"><b>A</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-B"><b>B</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-C"><b>C</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-D"><b>D</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-E"><b>E</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-F"><b>F</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-G"><b>G</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-H"><b>H</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-I"><b>I</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-K"><b>K</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-L"><b>L</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-M"><b>M</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-N"><b>N</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-P"><b>P</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-R"><b>R</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-S"><b>S</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-T"><b>T</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-U"><b>U</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-V"><b>V</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-W"><b>W</b></a> <a class="summary-letter-printindex" href="#Index_cp_letter-X"><b>X</b></a> </td></tr></table> </div> <hr> </div> </div> <div class="element-footnotes" id="SEC_Footnotes"> <div class="nav-panel"> <p> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="footnotes-heading">Footnotes</h4> <h5 class="footnote-body-heading"><a id="FOOT1" href="#DOCF1">(1)</a></h5> <p><em class="dfn">chain-load</em> is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.</p> <h5 class="footnote-body-heading"><a id="FOOT2" href="#DOCF2">(2)</a></h5> <p>The NetBSD/i386 kernel is Multiboot-compliant, but lacks support for Multiboot modules.</p> <h5 class="footnote-body-heading"><a id="FOOT3" href="#DOCF3">(3)</a></h5> <p>Only CRC32 data integrity check is supported (xz default is CRC64 so one should use –check=crc32 option). LZMA BCJ filters are supported.</p> <h5 class="footnote-body-heading"><a id="FOOT4" href="#DOCF4">(4)</a></h5> <p>There are a few pathological cases where loading a very badly organized ELF kernel might take longer, but in practice this never happen.</p> <h5 class="footnote-body-heading"><a id="FOOT5" href="#DOCF5">(5)</a></h5> <p>The LInux LOader, a boot loader that everybody uses, but nobody likes.</p> <h5 class="footnote-body-heading"><a id="FOOT6" href="#DOCF6">(6)</a></h5> <p>El Torito is a specification for bootable CD using BIOS functions.</p> <h5 class="footnote-body-heading"><a id="FOOT7" href="#DOCF7">(7)</a></h5> <p>Currently a backslash-newline pair within a variable name is not handled properly, so use this feature with some care.</p> <h5 class="footnote-body-heading"><a id="FOOT8" href="#DOCF8">(8)</a></h5> <p>However, this behavior will be changed in the future version, in a user-invisible way.</p> <h5 class="footnote-body-heading"><a id="FOOT9" href="#DOCF9">(9)</a></h5> <p>Current implementation of cryptsetup supports only 512/1024/2048/4096 byte sectors</p> </div> </body> </html>
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 font_char_metrics.png
PNG
16.1 KB
2018-11-24 17:13
EDIT
📄 grub-dev.html
HTML
178.3 KB
2026-03-18 00:00
EDIT
📄 grub.html
HTML
653.7 KB
2026-03-18 00:00
EDIT
📄 THANKS
?
1.4 KB
2018-11-24 17:13
EDIT